home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pacsoft!mike
- From: mike@pacsoft.com (Mike Stefanik)
- Newsgroups: comp.lang.c
- Subject: Re: How to randomly access files in C?
- Message-ID: <1371@pacsoft.com>
- Date: 2 Sep 92 04:32:15 GMT
- References: <17uctaINNco3@agate.berkeley.edu> <9224511.24878@mulga.cs.mu.OZ.AU>
- Organization: Pacific Software Group, Riverside, Ca.
- Lines: 12
-
- In an article, fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
- >Some files (eg. stdin) may not be seekable, in which case you would probably
- >have to store the last few lines in memory. However for most files,
- >ftell() and fseek() should do what you want (RTFM ;-).
-
- If portability is a concern, use fgetpos() and fsetpos(). The reason being
- that the fseek() and ftell() functions use a signed long integer as the
- offset -- which can be a problem with large files on 8 or 16 bit machines.
-
- --
- Mike Stefanik mike@pacsoft.com ...!uunet!pacsoft!mike
- Pacific Software Group, Riverside, CA
-