Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcdc!rml From: rml@hpfcdc.HP.COM (Bob Lenk) Newsgroups: comp.unix.wizards Subject: Re: File sizes > 2^32 bytes? Message-ID: <5980055@hpfcdc.HP.COM> Date: 24 May 89 23:38:42 GMT References: <400@siswat.UUCP> Organization: HP Ft. Collins, Co. Lines: 24 > What does POSIX > say about the maximum file size? A file size is represented by the type off_t, which is required to be an arithmetic type. This type is returned in the stat structure field st_size and used in the interface to lseek() and fcntl() (for file locking). An implementation can implement an arithmetic type longer than 32 bits. This will result in backward compatibility issues for most existing implementations. > (Are there any utilities > that actually interpret the sign bit of the file size/seek position, > which would prevent using the last 2 GB of the 32 bits?) The kernel does. The interface to lseek() permits negative values, which are especially useful relative to current position or to EOF. The current POSIX standard fails to explicitly require that off_t be a signed type, but any implementation that tried to interpret it as unsigned would have troubles. The current draft of a supplement to 1003.1 adds this requirement. Bob Lenk hplabs!hpfcla!rml rml@hpfcla.hp.com