How can I override a C++ standard-library class function? In my application, I use ofstream objects in many different places of code. And now I want to open files i
This is not answering your question directly as I wouldn't advise overriding ofstream::open.
Instead couldn't you use the first suggestion in this post? Open the file as you normally would to get the correct permissions, and then construct an ofstream from the file descriptor.