Boost logo

Boost Users :

From: Merrill Cornish (merrill.cornish_at_[hidden])
Date: 2006-03-01 14:56:25


Hector,

>>> how to lock a file (fstream) for reading/writing

Are you trying to lock the _file_ on disk for all applications running on the system? Or, are you trying to lock a stream opened to that file for different threads in your application?

In the first case, you need to use an OS-level lock, not Boost. In the second case, use a mutex as someone else suggested.

Merrill


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net