468,496 Members | 1,801 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,496 developers. It's quick & easy.

"ab" mode in fopen

Can I use this mode to create a new file , add some data and then
append more data ? How is it different from ab+ ?
Apr 10 '08 #1
3 16314
[Critical part of question in subject: "ab" mode in fopen]

pereges wrote:
>
Can I use this mode to create a new file , add some data and then
append more data ?
Yes.
How is it different from ab+ ?
"ab" is "append; open or create binary file for writing at end-of-file"
and "ab+" is "append; open or create binary file for update, writing at
end-of-file".

In other words, the difference is that "ab" is write-only, while "ab+"
is read/write.

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h|
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th*************@gmail.com>

Apr 10 '08 #2
On Apr 10, 10:18 pm, Kenneth Brody <kenbr...@spamcop.netwrote:
[Critical part of question in subject: "ab" mode in fopen]

pereges wrote:
Can I use this mode to create a new file , add some data and then
append more data ?

Yes.
How is it different from ab+ ?

"ab" is "append; open or create binary file for writing at end-of-file"
and "ab+" is "append; open or create binary file for update, writing at
end-of-file".

In other words, the difference is that "ab" is write-only, while "ab+"
is read/write.
Then in that case, ab+ is better if you want to do write followed by
read in same function.
Apr 10 '08 #3
pereges wrote:
On Apr 10, 10:18 pm, Kenneth Brody <kenbr...@spamcop.netwrote:
>[Critical part of question in subject: "ab" mode in fopen]

pereges wrote:
>>Can I use this mode to create a new file , add some data and then
append more data ?

Yes.
>>How is it different from ab+ ?

"ab" is "append; open or create binary file for writing at
end-of-file" and "ab+" is "append; open or create binary file for
update, writing at end-of-file".

In other words, the difference is that "ab" is write-only, while
"ab+" is read/write.

Then in that case, ab+ is better if you want to do write followed by
read in same function.
replace 'better' with 'correct' 8-)

Bye, Jojo
Apr 11 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Jim Hefferon | last post: by
2 posts views Thread by Randy Yates | last post: by
145 posts views Thread by Sidney Cadot | last post: by
26 posts views Thread by Michel Rouzic | last post: by
40 posts views Thread by Mark P | last post: by
reply views Thread by NPC403 | last post: by
3 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.