stl::fstream O_RDWR | O_CREAT

L

Luther Baker

Hi,

Which ios_base flags does one use to open an fstream for

std::ios::eek:ut | 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
 
J

John Harrison

Luther Baker said:
Hi,

Which ios_base flags does one use to open an fstream for

std::ios::eek:ut | 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
 
L

Luther Baker

John Harrison said:
....

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

Thanks John,

-Luther
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top