#165290 - 2006-08-01 06:03 PM
Maximum filesize for Open()
|
peaps
Fresh Scripter
Registered: 2005-04-12
Posts: 25
|
Quick question, -is there a maximum filesize that open() can cope with?
I am trying to open and readline() from a 66MB file and the first time I readline() it's coming back with an @ERROR code of -1 meaning end of file reached.
this is my code:
Code:
BREAK ON $x = open(3, "\\skynet\Safe\_index\gd.txt") ? "Open file " + $x $line = readline(3) ? "First read: " + @ERROR while @ERROR = 0 ? $line $line = readline(3) loop ? "Done" $x = close(3)
|
Top
|
|
|
|
#165293 - 2006-08-02 09:25 AM
Re: Maximum filesize for Open()
|
peaps
Fresh Scripter
Registered: 2005-04-12
Posts: 25
|
No the first line is about 20 characters long. I have checked for the @ERROR on open() but it's 0. So really not quite sure what's going on here.
The text file was created by running "DIR /B/S > gd.txt" on the command line, and this definately appends each line with @CRLF.
|
Top
|
|
|
|
#165294 - 2006-08-02 09:38 AM
Re: Maximum filesize for Open()
|
peaps
Fresh Scripter
Registered: 2005-04-12
Posts: 25
|
Hmm!! very interesting..
I changed the code replacing the UNC path with a local path:
Code:
$x = open(3, ".\gd.txt") ? "Open file " + $x $line = readline(3) ? "First read: " + @ERROR while @ERROR = 0 ? $line $line = readline(3) loop ? "Done" $x = close(3)
... and that works!
It obviously doesn't like BIG files over UNC.. Unless there's something wrong with my system. I have tried a smaller text file over UNC and it displayed it no problem.
Any ideas anyone?
|
Top
|
|
|
|
#165296 - 2006-08-02 10:14 AM
Re: Maximum filesize for Open()
|
peaps
Fresh Scripter
Registered: 2005-04-12
Posts: 25
|
Tried the ,2 on the open() line, but that made no difference.. There must be more things at play here.
And yeah Skynet was actually stolen from the Terminator film. Sounds quite good! And if I remember it tried to take over the world. That's kinda like what I'm trying to do with lots of kix scripts...
Edited by peaps (2006-08-02 10:17 AM)
|
Top
|
|
|
|
#165298 - 2006-08-02 11:18 AM
Re: Maximum filesize for Open()
|
peaps
Fresh Scripter
Registered: 2005-04-12
Posts: 25
|
No, I already created the dir output earlier, just by hand. It's basically an index file for rapid searching of a massive drive of documents. I have an AT job that runs an index every 24 hours over night, and the kix script just scans through the text file line by line looking for text matches.
|
Top
|
|
|
|
#165300 - 2006-08-02 02:46 PM
Re: Maximum filesize for Open()
|
peaps
Fresh Scripter
Registered: 2005-04-12
Posts: 25
|
Do you think that maybe this is one for Ruud? Would anyone else be prepared to try this out, i.e get a massive text file and see if you can open it over UNC. It doesn't need to be a separate physical machine, doing it on the same machine causes this problem.
|
Top
|
|
|
|
#165302 - 2006-08-02 09:38 PM
Re: Maximum filesize for Open()
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
Can upload here or similar sites.
http://www.rapidshare.de
|
Top
|
|
|
|
#165303 - 2006-08-02 11:42 PM
Re: Maximum filesize for Open() when using UNC path
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
peaps,
Just created a dir file on my computer. it was about 10 MB. Your script works fine.
Created a big file like this: Code:
copy dir1.txt+dir1.txt+dir1.txt+dir1.txt+dir1.txt+dir1.txt+dir1.txt dir.txt
Now I have a file of about 70 MB. Your script with UNC path returns Code:
Open file 0 First read: -1 Done
Scripts like I modified them: This one is erratic Code:
Break On $x = Open(3,"\\"+@WKSTA+"\c$\dir.txt") ? "Open file " + $x $line = ReadLine(3) ? "First read: " + @ERROR While @ERROR = 0 ? $line $line = ReadLine(3) Loop ? "Done" $x = Close(3)
This one is OK Code:
Break On $x = Open(3,"c:\dir.txt") ? "Open file " + $x $line = ReadLine(3) ? "First read: " + @ERROR While @ERROR = 0 ? $line $line = ReadLine(3) Loop ? "Done" $x = Close(3)
I tested this with kix32.exe 4.52 and 4.53 Beta 1 IMHO this is an issue that should be moved to the "Beta forum".
Edited by Witto (2006-08-03 09:43 AM)
|
Top
|
|
|
|
#165304 - 2006-08-03 10:13 AM
Re: Maximum filesize for Open() when using UNC path
|
peaps
Fresh Scripter
Registered: 2005-04-12
Posts: 25
|
Ok. So now two of us have reproduced this problem, it's not just me or my PC! I'm glad.. What's the next step then?
|
Top
|
|
|
|
#165306 - 2006-08-03 12:28 PM
Re: Maximum filesize for Open() when using UNC path
|
peaps
Fresh Scripter
Registered: 2005-04-12
Posts: 25
|
Well, that is certainly a possiblity. Especially if I zip the file first. It goes from 66MB to 4.5MB, then unzip (pkunzip) and keep it as a local cache.
But I was more getting at the apparent problem of opening large files over UNC paths; how should this be addressed?
|
Top
|
|
|
|
Moderator: ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 394 anonymous users online.
|
|
|