home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!mips!darwin.sura.net!haven.umd.edu!wam.umd.edu!walrus
- From: walrus@wam.umd.edu (Udo K Schuermann)
- Subject: SAS/C 5.10b fopen(...,"w+") bug?
- Message-ID: <1992Jul26.190553.26493@wam.umd.edu>
- Summary: "w+" doesn't preserve file as documented
- Sender: usenet@wam.umd.edu (USENET News system)
- Nntp-Posting-Host: wam.umd.edu
- Organization: University of Maryland, College Park
- Distribution: comp
- Date: Sun, 26 Jul 1992 19:05:53 GMT
- Lines: 31
-
- Hi, it's me again. Seems all I ever have is problems :-(
-
- I use SAS/C 5.10b under KS2.04 and am opening a file with a statement such
- as the following:
-
- struct FILE *myFile;
- myFile = fopen("t:test","w+");
-
- This clears out the file if it contains any information instead of preserving
- existing information! The documentation on page L72-L73 describes the use of
- the "w+" mode as 1) creating the file if it doesn't exist yet, 2) preserving
- existing contents (WHICH IT DOESN'T!), 3) providing r/w access to the file.
-
- The function behaves exactly as if I had not specified the "+" symbol in the
- mode. I have though. I have I have I have! :-/
-
- Is this a known problem and does this have a workaround? I've traced
- through the assembly of the fopen() call until I got thoroughly lost; it
- seemed, though that the fopen() function called the level 1 open()
- function. So if this problem propagates to the level 1 open() then what
- can I do?
-
- I've now spent too many hours on it, even slept over it, and the problem
- persists. Resorting to a sequence of "r" and "w" calls is not really an
- acceptable solution for a variety of reasons.
-
- Anyone? Please?!?
-
- ._. Udo Schuermann "If I went around calling myself emperor just because
- ( ) walrus@wam.umd.edu some moistened bint lobbed a scimitar at me, they'd
- Seeking virtual memory put me away!" -- Monty Python's "Holy Grail"
-