[erlang-questions] efile_drv.c bug?

Darren New dnew@REDACTED
Tue Jun 17 17:43:26 CEST 2008


Raimo Niskanen wrote:
> I suppose you noticed that macro is not used, so there is even
> a question if it was a real bug or not...

I did not, actually. I was basically looking for why only 4G files were 
supported. Then I thought to run it under Linux, and Linux supports >4G 
files, so I figured it wasn't something fundamental about the file 
driver protocol or something.

>> Any idea why Windows (XP/SP2/32bit) can't handle files >4G but Linux can 
>> with the same release? Is this something expected to get fixed eventually?
> 
> If I recall correctly, file pointers (off_t) are signed in Windows
> but there are extensions in Unix that use unsigned off_t but
> ((off_t) -1) as an error return value, so it is possible on
> many 32 bit Unixes to have almost 4GByte files, but 32 bit
> Windows is stuck with its 2GByte limit.

It turns out Linux will happily seek past 5G, so I don't think that's it.

In private mail (likely mistakenly sent to me instead of the list ;-) 
I'm told it's because Windows in its structures represent file sizes as 
two 32-bit integers, and the code just doesn't compensate properly.

Martin Dvořák wrote:
 > However, FAT32 has a 4GB file size limit which may be the problem here.
 > The solution may be NTFS which has 2^64 bytes limit.

No, I'm using a program in a different language to build a 6G file on an 
NTFS partition, then trying to read and append and such. Good 
suggestion, tho.

-- 
Darren New / San Diego, CA, USA (PST)
  Helpful housekeeping hints:
   Check your feather pillows for holes
    before putting them in the washing machine.



More information about the erlang-questions mailing list