- From: Paul <nospam@xxxxxxxxxx>
- Date: Sun, 17 Aug 2008 21:37:58 -0400
Bill Cunningham wrote:
"Ian Collins" <ian-news@xxxxxxxxxxx> wrote in message news:6grvbqFhb2hlU5@xxxxxxxxxxxxxxxxxxxxx
So what does your documentation well you about append mode?It just says append is a possible mode with a+ also which is append-read mode. Plus this book tells me that garbage about using t if I want for text mode. I know that's not portable stdc.
Is my main online reference. I've been thinking my trouble is in fscanf. It might be in fopen's mode.
"The argument mode points to a string beginning with one of the following
sequences (Additional characters may follow these sequences.):
a Open for appending (writing at end of file). The file is created if
it does not exist. The stream is positioned at the end of the file. <---- yikes
These functions return the number of input items successfully matched and assigned,
which can be fewer than provided for, or even zero in the event of an early matching
The value EOF is returned if the end of input is reached before either the first
successful conversion or a matching failure occurs. EOF is also returned if a read
error occurs, in which case the error indicator for the stream (see ferror(3)) is
set, and errno is set indicate the error."
Defensive programming, means checking the values returned by things like fscanf.
Wouldn't you be curious, whether fscanf converted zero, one, or two items ? If the
answer is not two, then X or Y could contain bogus information. And if an end of
file was encountered, you'd probably want to know about that also. There are many
possible outcomes, when handling file I/O.
- Prev by Date: Re: Amount OF Memory...,
- Next by Date: Re: fscanf
- Previous by thread: Re: fscanf
- Next by thread: Re: fscanf