Xref: utzoo comp.sys.amiga:43396 comp.sys.amiga.tech:8091 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!cs.utexas.edu!sun-barr!newstop!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: Lattice 5.02 Keywords: stat + 5.04 Message-ID: <127655@sun.Eng.Sun.COM> Date: 9 Nov 89 18:48:30 GMT References: <1989Nov8.173040.17138@cat.fulcrum.bt.co.uk> Sender: news@sun.Eng.Sun.COM Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Organization: Sun Microsystems, Mountain View Lines: 16 Simon Raybould writes: >I am trying to find out the size of a file in lattice C V5.02. >I have found the command to get the modification time and various other >file attributes, but not the file size. This is UNIX history affecting the Amiga. Actually, there is no such subroutine. Instead, you simply look at the return value from lseek(). Try this : fd = open("some file name", O_RDONLY); /* seek to the end of the file */ size = lseek(fd, 0L, 2); --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you. "If I were driving a Macintosh, I'd have to stop before I could turn the wheel."