home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4240 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.2 KB  |  48 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: cs.vu.nl!irmen
  3. From: irmen@cs.vu.nl (Irmen de Jong)
  4. Subject: Re: File sizes
  5. Nntp-Posting-Host: schokker.cs.vu.nl
  6. References: <4gd9pu$cpr@mn5.swip.net> <WXQ7y*5+f@yaps.rhein.de> <4gjs20$i68@btmpjg.god.bel.alcatel.be> <Dn81zD.H5M.0.-s@cs.vu.nl> <4grop1$puv@btmpjg.god.bel.alcatel.be>
  7. Sender: news@cs.vu.nl
  8. Organization: Dept. of Computer Science, Vrije Universiteit Amsterdam
  9. Date: Mon, 26 Feb 1996 12:51:02 GMT
  10. X-Newsreader: TIN [version 1.2 PL2]
  11. Message-ID: <DnDvp3.5Mt.0.-s@cs.vu.nl>
  12.  
  13. On 26 Feb 1996 07:50:57 GMT barnhoorn@nlev00 (barnhoorn@nlev00) wrote:
  14.  
  15. : In article <Dn81zD.H5M.0.-s@cs.vu.nl>, irmen@cs.vu.nl (Irmen de Jong) writes:
  16. : |> On 23 Feb 1996 07:57:52 GMT barnhoorn@nlev00 (barnhoorn@nlev00) wrote:
  17. : |> : |> > What's the best way of finding out the size of a file? Do I have to use 
  18. : |> : |> > Examine()
  19. : |> : ..or do it in ANSI-C, by opening the file, seeking to the end of it
  20. : |> : and getting the number of bytes returned from fseek().
  21. : |> Aaaargh why does nobody use fstat()? Seeking to the end of a many-megabyte-file
  22. : |> can take ages, especially on floppy. fstat() (and dos.library/Examine()) are
  23. : |> instantaneous, AFAIK.
  24.  
  25. : I admit that fseek() might take a long time to return. But I think
  26. : fseek() will return the real filesize, also on XPK-devices, because
  27. : it has to be unpacked.
  28. : Is fstat() a function that decrunches the file also?
  29.  
  30. : ---------------------------------------------------------------------------
  31. : Jaco Barnhoorn               barnie@xs4all.nl
  32.  
  33. Dunno. I think not. I'm almost 100% sure that fstat() is implemented using
  34. Examine() or ExamineFH() (that is how I should do it).
  35.  
  36. Anyway, how often are you interested in the file size after decrunching?
  37. Myself: 0 times so far. I only care about the actual file size on disk.
  38. Thus: I'm perfectly happy with Examine(), ExamineFH() (very conveninent)
  39. and fstat() for ANSI C.
  40.  
  41. By the way: doesn't Examine() on an XPK-device also return the file size
  42. after decrunching? I think so. Thus: the fseek() to the end of the file
  43. is stupid, IMHO.
  44.  
  45. --
  46. / Irmen de Jong (email: irmen@cs.vu.nl WWW: http://www.cs.vu.nl/~irmen/)  \
  47. \                 ``Nothing lasts forever'' -- Species                    /
  48.