home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!stanford.edu!ames!elroy.jpl.nasa.gov!jato!jdickson
- From: jdickson@jato.jpl.nasa.gov (Jeff Dickson)
- Subject: Re: Determining file length
- Message-ID: <1992Sep15.155109.13858@jato.jpl.nasa.gov>
- Organization: Jet Propulsion Laboratory
- References: <mbs.108r@adastra.cvl.va.us>
- Date: Tue, 15 Sep 1992 15:51:09 GMT
- Lines: 21
-
- In article <mbs.108r@adastra.cvl.va.us> mbs@adastra.cvl.va.us (Michael B. Smith) writes:
- >In article <1992Sep14.152206.28572@cs.uow.edu.au> u9147063@cs.uow.edu.au (Richard Barry Ling) writes:
- >> Is there a better way to find file length in assembly language than to do a
- >> Lock() on the file, allocate a half-k buffer or so for the crap Examine()
- >> returns (I only want one long word of it :-(... ) pass that to Examine,
- >> extract the file length, free the Examine() buffer, unlock the file... it's
- >> screenfulls of code and an utter kludge. Can the file length be found in the
- >> file structure you get from Open() or something?
-
- Allocate a temporary FIB on the stack, convert it to a BPTR, examine the
- object, extract the size of the file, and finally deallocate the FIB. Now, the
- C= folks tried to scare us all into using AllocDosObject for such purposes,
- but for now anyways it's a farce. The only requirement is that the FIB be long
- word alligned.
-
- You wanted to avoid having to lock the object, but if you're planning to open
- it anyways might as well use the new function to convert a lock into a file
- handle.
-
- jeff
-
-