Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!rutgers!cbmvax!cbmehq!cbmfra!swinjm!forgeas From: forgeas@swinjm.UUCP (Jean-Michel Forgeas) Newsgroups: comp.sys.amiga.tech Subject: Re: Wanted: Filelength() function Message-ID: Date: 1 Aug 90 13:44:56 GMT References: <2671@mindlink.UUCP> Lines: 22 In article <2671@mindlink.UUCP> a665@mindlink.UUCP (Anthon Pang) writes: >I don't think there's a function that returns the filelength of a file, with >AmigaDOS. But I need an equivalent...how do you determine the length of a file >given only the file handle (eg from an Open)? There must be a way to find the >[...] >Thanks. Alexander Livshits showed me this little trick, here it is: int filelength( fh ) { Seek( fh, 0, OFFSET_END ); return( Seek( fh, 0, OFFSET_BEGINNING ) ); } -- \___/ Jean-Michel Forgeas \-/ cbmvax!cbmehq!cbmfra!swinjm!forgeas | The Software Winery -^- And, where is the universe ?