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