Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uwm.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: size of a file Message-ID: <11978@smoke.BRL.MIL> Date: 18 Jan 90 12:34:06 GMT References: <10890@encore.Encore.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 14 In article <10890@encore.Encore.COM> peralta@multimax.encore.com (Rick Peralta) writes: >In most implementations a pointer to the offset in the file is maintained. >The file (and filesystem) cannot ecxcede the limit of the int. So, how >can a very large file be accommodated? On a 16 bit machine this must have >been a critical problem. Does anyone know how it was overcome? On modern UNIX systems the file offset is a long (at least 32 bits). This still causes problems for a few systems with huge files.. Before long was added to C, i.e. up through Sixth Edition UNIX, it was necessary to perform a seek in two parts, one involving a (512-byte) block offset and the other involving a byte offset (usually within the block). The 16-bit system call was seek(), thus the improved 32-bit version was called lseek().