Pastey error in filetest on huge files
- Posted by useless_
Oct 19, 2012
--
--
--
--
-- how big a file can be opened, and when will reading fail?
--
--
include std/filesys.e -- for move, del, create, dir
include std/console.e -- any_key()
atom size = 0
object junk, readfile
puts(1,"filesizetest3.exw\n\n")
sequence readfilename = "E:\\YAGO\\yago2core_20120109\\using.tsv"
---------------------------------------------------------------------------
junk = dir(readfilename)
puts(1,"\nFilesize reported by dir(): "&sprintf("%d",junk[1][3])&"\n\n")
puts(1,"\nfilesize actually read in with gets() :\n\n")
readfile = open(readfilename,"rb")
junk = gets(readfile)
while not equal(-1,junk) do
size += length(junk)
puts(1,sprintf("%d",size)&"\r")
junk = gets(readfile)
end while
close(readfile)
puts(1,"\n\n\nwell, if i got here, there was no crash!\n\n")
-----------------------------------------------------------------------------
puts(1,"\n----------------------------------------------\n")
junk = dir(readfilename)
puts(1,"\nfilesize actually read in with gets() :\n\n")
readfile = open(readfilename,"rb")
junk = gets(readfile)
while sequence(junk) do
size += length(junk)
puts(1,sprintf("%d",size)&"\r")
junk = gets(readfile)
end while
close(readfile)
puts(1,"\n\n\nwell, if i got here, there was no crash!\n\n")
-----------------------------------------------------------------------------
any_key()
abort(0)