By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,750 Members | 1,165 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,750 IT Pros & Developers. It's quick & easy.

stl::fstream O_RDWR | O_CREAT

P: n/a
Hi,

Which ios_base flags does one use to open an fstream for

std::ios::out | std::ios::in | (create if necessary)

I do NOT necessarily want to truncate or append to the file.

I realize I can do it in two steps by checking the state of the file
stream after trying to open it, but I wanted to be sure I was not
missing a flag like O_RDWR | O_CREAT.

Thanks,

-Luther
Jul 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Luther Baker" <lu*********@yahoo.com> wrote in message
news:46**************************@posting.google.c om...
Hi,

Which ios_base flags does one use to open an fstream for

std::ios::out | std::ios::in | (create if necessary)

I do NOT necessarily want to truncate or append to the file.

I realize I can do it in two steps by checking the state of the file
stream after trying to open it, but I wanted to be sure I was not
missing a flag like O_RDWR | O_CREAT.


This question was asked recently, see the thread 'fstream..' by dumboo. The
short answer is do it in two steps.

john
Jul 22 '05 #2

P: n/a
"John Harrison" <jo*************@hotmail.com> wrote in message news:<2h************@uni-berlin.de>...
"Luther Baker" <lu*********@yahoo.com> wrote in message
news:46**************************@posting.google.c om... ....
This question was asked recently, see the thread 'fstream..' by dumboo. The
short answer is do it in two steps.


Thanks John,

-Luther
Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.