Hi all,
Maybe victor can answer this if he remembers, but at one point, he posted code, here or on the qbasicnews forum.
I think (not sure) the code used the windows API to open files in 64bit mode so to speak so that the classic 2 gig file sile limite could be overcome with that code.
Anyone know what I'm talking about? :)
I've searched here and on the qbasicnews forum before posting this. to no avail.
dos/windows 2 gig file limit
-
- Posts: 612
- Joined: Jun 15, 2005 13:22
- Location: Upstate NY
- Contact:
Running under Windows 2000 and using Version 0.21.0 (03-09-2009) I can exceed that limit with this code:
It takes several minutes to create the file, and on a system with only 512MB of memory it’s hard to do much with the file, but the created file appears to be OK and the reported size is correct.
I did find a Microsoft KB article that shows how to overcome VBA’s 2GB limit by using the API directly:
http://support.microsoft.com/kb/189981
Code: Select all
dim as string filler
filler = string(1000000,"X")
open "d:\bigfile.bas" for output as 1
for i as integer = 1 to 3000
locate 1,1,0
print i;
print #1, filler;
next
print
print lof(1)
close
sleep
kill "d:\bigfile.bas"
print "OK"
sleep
cls
open "d:\bigfile.bas" for binary as 1
for i as integer = 1 to 3000
locate 1,1,0
print i;
put #1,, filler
next
print
print lof(1)
close
sleep
kill "d:\bigfile.bas"
print "OK"
sleep
I did find a Microsoft KB article that shows how to overcome VBA’s 2GB limit by using the API directly:
http://support.microsoft.com/kb/189981
-
- Posts: 612
- Joined: Jun 15, 2005 13:22
- Location: Upstate NY
- Contact:
Thank you MichaelW,
Hmmm, i'm running XP Pro on one laptop and Vista Home Basic and both seem to work good with your code. awesome. As you say, files seem intact and written as expected. I'll do further testing to make sure they are indeed 100% safe :)
If Victor reads this and remembers the code he posted, if you can post it again just for references :)
Hmmm, i'm running XP Pro on one laptop and Vista Home Basic and both seem to work good with your code. awesome. As you say, files seem intact and written as expected. I'll do further testing to make sure they are indeed 100% safe :)
If Victor reads this and remembers the code he posted, if you can post it again just for references :)
Michael and Zippy are the Win API masters here, i can't remember ever using it to do file manipulation, sorry (my memory is quite bad though, i'm getting too old, some will say, heh).
But, if i remember (hmm, hmm), DrV added support for huge-files >2GB to the runtime library releases ago, so any file function/statement should work.
But, if i remember (hmm, hmm), DrV added support for huge-files >2GB to the runtime library releases ago, so any file function/statement should work.