How to implement File locking for fstream class object

pcarlini@unitus.it pcarlini@unitus.it
Mon Feb 3 15:26:00 GMT 2003


Quoting Ajay Bansal <Ajay_Bansal@infosys.com>:

> Hi,
> 
> I am using fstream in my application. I need to implement locking on my
> file. Earlier fd method of filebuf class was available which gave me
> filedescriptor. That file descriptor can be used by lockf or fcntl
> system calls to implement file locking. How do I achive file locking
> using me fstream object now?????

Have a look at:

  http://suter.home.cern.ch/suter/RWLock.html

This should also be in the FAQ, but I never got around to do it :-(

Paolo.



More information about the Libstdc++ mailing list