lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, 2008-02-22 at 22:44 +1100, Duck wrote:
> >Er, shouldn't the C library be able to handle
> >large files using FILE?
> 
> Depends. fseek() takes a long (i.e. a signed long) as the file offset, so 
> if long is 32-bits then you can't get past 2GB-1.
> 
> Anyway, a default build of Lua on my 32-bit Linux has a 2GB-1 size limit 
> on files it can process. (My QEMU virtual machine disk images are often 
> bigger than that.)

Well, you can: you use fseek(..., SEEK_CUR); iteratively and keep track
of the pointer yourself.

B.