home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / amiga / programm / 13344 < prev    next >
Encoding:
Internet Message Format  |  1992-09-14  |  1.4 KB

  1. 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
  2. From: u9147063@cs.uow.edu.au (Richard Barry Ling)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Determining file length
  5. Message-ID: <1992Sep14.152206.28572@cs.uow.edu.au>
  6. Date: 14 Sep 92 15:22:06 GMT
  7. Organization: Dept of Computer Science, Wollongong University, Australia
  8. Lines: 18
  9.  
  10.  
  11. Suppose I want to take a filename from the command line, get the size of the
  12. file, allocate an exact-size buffer, and read the file into the buffer...
  13. (this is, in fact, exactly what I want to do...)
  14.  
  15. Is there a better way to find file length in assembly language than to do a
  16. Lock() on the file, allocate a half-k buffer or so for the crap Examine()
  17. returns (I only want one long word of it :-(... ) pass that to Examine,
  18. extract the file length, free the Examine() buffer, unlock the file... it's
  19. screenfulls of code and an utter kludge. Can the file length be found in the
  20. file structure you get from Open() or something?
  21.  
  22. Thanx for your help...
  23.  
  24. --------------------- Richard.  u9147603@cs.uow.edu.au ---------------------
  25. "The rooster stared back at me, his power and confidence almost overwhelming.
  26. Down below, a female paused warily at the coop's entrance. I kept the camera
  27. running. They were beautiful, these 'Chickens in the mist'."  -  Gary Larson
  28.