home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!noc.near.net!nic.umass.edu!dime!alice.cs.umass.edu!cook
- From: cook@cs.umass.edu (Robert Cook)
- Newsgroups: comp.sys.mac.programmer
- Subject: Possible Bug with fseek in MPW C 3.2.4?
- Message-ID: <57670@dime.cs.umass.edu>
- Date: 17 Dec 92 15:38:55 GMT
- Sender: news@dime.cs.umass.edu
- Organization: University of Massachusetts
- Lines: 31
- X-UserAgent: Nuntius v1.1.1d12
- X-XXMessage-ID: <A756093D9A0128C5@alice.cs.umass.edu>
- X-XXDate: Thu, 17 Dec 92 15:38:53 GMT
-
- I'm trying to increase the size of a file using the function fseek with
- no luck,
- i.e.
- err=fseek(fp,offset,SEEK_END);
- the fseek statement returns back an error, -1.
-
- According to the book "C - A Reference Manual" third edition, by Samuel
- P. Harbison and
- Guy L. Steele Jr. this is possible, and I quote from pg 305, "If
- wherefrom is SEEK_END
- and offset is positive, then the file is extended the indicated amount
- from it end with
- unspecified contents."
-
- The MPW 3.0 C Reference Manual also eludes to this fact by stating on pg
- 122, "If whence
- is SEEK_END, the new position is the size of the file plus offset." But
- on pg 123 it states
- under "Return values", "An example of an improper seek is an fseek before
- the beginning of,
- or past the end of, the file."
-
- So what gives, can I use fseek to increase the size of a file?
- If so, does this mean MPW C 3.2.4 has a bug in it?
-
- Thanks,
-
- Bob Cook
- Computer Science Department
- University of Massachusetts
- Amherst, MA 01003
-