home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pmafire!news.dell.com!swrinde!sdd.hp.com!uakari.primate.wisc.edu!caen!batcomputer!munnari.oz.au!metro!cs.uow.edu.au!u9147063
- From: u9147063@cs.uow.edu.au (Richard Barry Ling)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Determining file length
- Message-ID: <1992Sep14.152206.28572@cs.uow.edu.au>
- Date: 14 Sep 92 15:22:06 GMT
- Organization: Dept of Computer Science, Wollongong University, Australia
- Lines: 18
-
-
- Suppose I want to take a filename from the command line, get the size of the
- file, allocate an exact-size buffer, and read the file into the buffer...
- (this is, in fact, exactly what I want to do...)
-
- 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?
-
- Thanx for your help...
-
- --------------------- Richard. u9147603@cs.uow.edu.au ---------------------
- "The rooster stared back at me, his power and confidence almost overwhelming.
- Down below, a female paused warily at the coop's entrance. I kept the camera
- running. They were beautiful, these 'Chickens in the mist'." - Gary Larson
-