home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / c / 13504 < prev    next >
Encoding:
Internet Message Format  |  1992-09-10  |  1.4 KB

  1. Path: sparky!uunet!spool.mu.edu!umn.edu!cybrspc!roy
  2. From: roy%cybrspc@cs.umn.edu (Roy M. Silvernail)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: File Handling
  5. Message-ID: <290wqB3w165w@cybrspc.UUCP>
  6. Date: Fri, 11 Sep 92 00:54:12 CDT
  7. References: <14444@goanna.cs.rmit.oz.au>
  8. Organization: Villa CyberSpace, Minneapolis, MN
  9. Lines: 25
  10.  
  11. ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
  12.  
  13. > You also want to find out about the ANSI functions fgetpos(), fsetpos().
  14.  
  15. I know this may be a stoopid question, but I just looked up those two
  16. calls in my manual.  Whatever good are they?
  17.  
  18. (Borland Turbo C++ 1.01)
  19.  
  20. "fgetpos stores the position of the file pointer associated with the
  21. given stream in the location pointed to by _pos_.  The exact value is a
  22. magic cookie; in other words, it is irrelevant to your purposes."
  23.  
  24. So I can get a file position with fgetpos() and restore it with
  25. fsetpos().  Somehow, this seems to lack utility to me.  The vast
  26. majority of file positioning I do is related to locating data within the
  27. file, for which I must calculate a position.  It doesn't appear that
  28. fsetpos() is useful for that purpose.  So, why use it at all?
  29.  
  30. Can someone give a non-trivial example?  (or am I missing something
  31. _extremely_ obvious here?)
  32. --
  33. Roy M. Silvernail --    [my machine ] "Sometimes, you're the windshield....
  34. roy%cybrspc@cs.umn.edu  [my opinions]            sometimes, you're the bug!"
  35. cybrspc!roy@cs.umn.edu  [my $0.0275 ]                      --Mark Knopfler
  36.