standard c++ basic_fstream question

A

Avner

I have a C++ code which I want to upgrade to the standard C++

The code constructs a file and sets the file permission
The new iostream library does not include filebuf::eek:penprot

The old ofstream constructor (<fstream.h>) accepts a third parameter (int
nProt = filebuf::eek:penprot)

i.e. ofstream( const char* szName, int nMode = ios::eek:ut, int nProt =
filebuf::eek:penprot );

but the standard ofstream constructor (<fstream>) does not accept the third
parameter anymore.


How do I preserve the functionality to set the file permission?

Thanks,
Avner
 
V

Victor Bazarov

Avner said:
I have a C++ code which I want to upgrade to the standard C++

The code constructs a file and sets the file permission
The new iostream library does not include filebuf::eek:penprot

The old ofstream constructor (<fstream.h>) accepts a third parameter
(int nProt = filebuf::eek:penprot)

i.e. ofstream( const char* szName, int nMode = ios::eek:ut, int nProt
= filebuf::eek:penprot );

but the standard ofstream constructor (<fstream>) does not accept the
third parameter anymore.


How do I preserve the functionality to set the file permission?

You can't. It doesn't exist in the standard library. You need to
use platform-specific means of working with files.

V
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top