
1 Mar
2006
1 Mar
'06
7:56 p.m.
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