Hi,
I've been having some problems writing files using C++ in Linux(g++ compiler).
I'm trying to write a program in both Windows and Linux to write some data to a file and prevent it from being shared whilst this is happening. In Windows i've been using the following,
fThirdFile.open("file3.txt",ios::out,filebuf::no_share);
When i compile this in Linux i get a parse error after filebuf. Is there a way to deny sharing in C++?
If i was doing this in C i would use flock() but it takes a filedescriptor not a object. I need to write this in C++.
Thanks,
Gaz
|