Re: Help - I'm at wit's end...
From: BRG (brg_at_nowhere.org)
Date: 12/30/04
- Next message: Joe Peschel: "Re: [Lit.] Buffer overruns"
- Previous message: newstome_at_comcast.net: "Re: [Lit.] Buffer overruns"
- In reply to: Ben Pfaff: "Re: Help - I'm at wit's end..."
- Next in thread: Joe Peschel: "Re: Help - I'm at wit's end..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 30 Dec 2004 00:05:19 +0000
Ben Pfaff wrote:
> BRG <brg@nowhere.org> writes:
>
>
>>Interesting - I was not aware that a 't' option existed - is this an
>>ANSI designated file opening mode?
>
>
> There is no `t' option--at least, not portably. No one
> interested in writing portable code would use `t', because it
> invokes undefined behavior. Here is the complete list from the
> C99 standard, section 7.19.5.3 paragraph 3:
>
> 3 The argument mode points to a string. If the string is one of
> the following, the file is open in the indicated
> mode. Otherwise, the behavior is undefined.228)
>
> r open text file for reading
> w truncate to zero length or create text
> file for writing
> a append; open or create text file for
> writing at end-of-file
> rb open binary file for reading
> wb truncate to zero length or create binary
> file for writing
> ab append; open or create binary file for
> writing at end-of-file
> r+ open text file for update (reading and
> writing)
> w+ truncate to zero length or create text
> file for update
> a+ append; open or create text file for
> update, writing at end-of-file
> r+b or rb+ open binary file for update (reading and
> writing)
> w+b or wb+ truncate to zero length or create binary
> file for update
> a+b or ab+ append; open or create binary file for
> update, writing at end-of-file
Thanks for the detail, which is most helpful.
Brian Gladman
- Next message: Joe Peschel: "Re: [Lit.] Buffer overruns"
- Previous message: newstome_at_comcast.net: "Re: [Lit.] Buffer overruns"
- In reply to: Ben Pfaff: "Re: Help - I'm at wit's end..."
- Next in thread: Joe Peschel: "Re: Help - I'm at wit's end..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|