|
-
April 2nd, 2001, 11:47 AM
#1
FILE I/O
I get an "Out of string Space" error (errorcode 14) when I try to open an extremely large file.
I use "Open App.Path & "\bib.dat" For Input As #FileHandle ..." instruction.
Is there any restriction on the size of a file you open? I don't get the problem with a smaller version or
can it be matter of lack of enough RAM/diskspace?
-
April 2nd, 2001, 12:21 PM
#2
Re: FILE I/O
I believe that string length is limited. When you open a huge file ( which exceeds the max length of the string) you are getting this error.
Iouri Boutchkine
[email protected]
-
April 2nd, 2001, 12:28 PM
#3
Re: FILE I/O
I don't know, but you could use CreateFile() API
-
April 2nd, 2001, 12:49 PM
#4
Re: FILE I/O
try to use file system object
dim oFile as scripting.textstream
dim FSO as scripting.filesystemobject
dim str() as stringdim i as integer
set fso = new scripting.filesystemobject
set ofile = fso.opentextfile("Path to The File.txt", ForReading, false)
while not ofile.AtEndOfStream
str = split(ofile.readline, " ")
for i = lbound(str) to ubound(str)
msgbox str(i)
next i
wend
ofile.close
set ofile = nothing
set fso = nothing
don't forget to set referens to scripting objrct
Iouri Boutchkine
[email protected]
-
April 2nd, 2001, 02:04 PM
#5
Re: FILE I/O
A VB string or BSTR is a structure consisting of a 32 bit number (size of string) and the string data itself (remember it is a Unicode string so the characters are 16 bits not 8). Since the length of the string is expressed as a 32 bit number the max length of a VB string is 2,147,483,647 characters (a little over 2.1 GB).
Hope this helps.
Spectre
-
April 3rd, 2001, 09:32 AM
#6
Re: FILE I/O
I resolved my problem with FSO - thanks for all the replies.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|