Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!ucsd!pacbell.com!pacbell!att!mcdchg!ddsw1!igloo!miroc!caw From: caw@miroc.Chi.IL.US (Christopher A. Wichura) Newsgroups: comp.sys.amiga.tech Subject: Re: Wanted: Filelength() function Message-ID: Date: 1 Aug 90 18:17:53 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 This is easy to do. After opening the file, do a Seek() to an offset of zero from the end of the file. Then do another Seek() to offset zero from current and the return value is the size of the file. Granted, this is a little more overhead than having a Lock() and doing an Examine(), but it is a lot easier. -=> CAW /////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Christopher A. Wichura caw@miroc.chi.il.us (my amiga) u12401@uicvm.uic.edu (my school account) Please! Do not send mail to my school account unless mail to miroc bounces. I often do not check uicvm.uic.edu for periods in excess of a week. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//////////////////////////////////////