
On 04/13/2010 10:02 AM, Adam Badura wrote:
Is it possible to lock a file with Boost.Filesystem to prevent its deletion, writing or reading?
Against whom/what do you want to lock the file? On which platform?
Against other processes will suffice I guess. On Windows platform, however using Boost.Filesystem I hope for (at least some) platform independence.
To clarify this. Your application is made up from several processes and you want to implement locking between those or do you want to lock against completely unrelated processes? For the first case you can use boost.interprocess for the second case i don't see a portable solution as for example POSIX systems are implementing advisory locking (as opposed to mandatory locking on Windows). On such system you can only have locking between cooperating processes which are obeying to a locking protocol. Frank