Boost logo

Boost :

From: Jan Langer (jan_at_[hidden])
Date: 2002-03-05 15:51:48


--On Montag, 4. März 2002 13:36 -0500 Beman Dawes <bdawes_at_[hidden]> wrote:
> At 05:50 AM 3/4/2002, Jan Langer wrote:
> >... i think
> >modifying the same file in parallel with two dir_entries or similar
> >things should be prohibited.
>
> You can't, at least in general. Here is a new "reality" I've added to
> the design docs:
>
> Directory trees, directories, files, and file attributes are in effect
> shared between all threads, processes, and computers which have access to
> the file system. That may well include computers on the other side of
> the world or in orbit around the world. This implies that file system
> operations may fail in unexpected ways. For example:
>
> assert( exists("foo") == exists("foo") ); // may fail!
> assert( is_directory("foo") == is_directory("foo"); // may fail!
>
> In the first example, the file may have been deleted between calls to
> exists(). In the second example, the file may have been deleted and then
> replaced by a directory of the same name between the calls to
> is_directory().

you're right. let me say my sentence above in a different way:
the user has to care if modifying the same file in parallel with two dir_entries or similar things results in unexpected behaviour.

jan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk