473,378 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

"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 17506
[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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Jim Hefferon | last post by:
Hello, I'm getting an error join-ing strings and wonder if someone can explain why the function is behaving this way? If I .join in a string that contains a high character then I get an ascii...
2
by: Randy Yates | last post by:
Having done a bit of Access Basic programming, I'm realizing that AB does seem to have (as much as I hate to admit it since I think it's a toy language) an advantage over C++. Let's say I have a...
145
by: Sidney Cadot | last post by:
Hi all, In a discussion with Tak-Shing Chan the question came up whether the as-if rule can cover I/O functions. Basically, he maintains it can, and I think it doesn't. Consider two...
33
by: baumann.Pan | last post by:
hi all, i want to get the address of buf, which defined as char buf = "abcde"; so can call strsep(address of buf, pointer to token);
26
by: Michel Rouzic | last post by:
I have a binary file used to store the values of variables in order to use them again. I easily know whether the file exists or not, but the problem is, in case the program has been earlier...
40
by: Mark P | last post by:
I'm implementing an algorithm and the computational flow is a somewhat deep. That is, fcn A makes many calls to fcn B which makes many calls to fcn C, and so on. The return value of the outermost...
18
by: njgreen2001 | last post by:
I thought the length of this might give me problems. Any suggestions on how to shorten it? Expression: =IIf(="A Pos" And ="A Pos",(DLookUp("","")), IIf(="A Pos" And ="A...
3
by: MIUSS | last post by:
Hello everyone! I got a problem with creating new line... I tried this: lstrcpy(NewLineIdr, TEXT("\r\n")); I already tried this: NewLineIdr = 0x000D; NewLineIdr = 0x000A;...
4
by: andre rodier | last post by:
Hello, I need to display or propose a jpeg image on a web page. When I need to display the image, I use this code : header("Content-Length: $fileSize") ; header("Content-Type: $type") ;...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.