From: Walter Landry (wlandry_at_[hidden])
Date: 2004-03-09 12:39:11
Beman Dawes <bdawes_at_[hidden]> wrote:
> At 01:55 AM 3/9/2004, Vladimir Prus wrote:
> >After all, caller only cares if directory exists, if it was created by
> >another thread it's ok.
> That's an interesting thought. Of course, it might not be another thread
> but rather another process that created the directory, and that could be a
> sign of real trouble.
Exactly. Normally people use lock-files, but I personally have a use
for lock-directories. If boost::filesystem starts swallowing errors,
it makes it more difficult to achieve that.
I would say that people who don't care whether a directory is created
should just catch the exception themselves. Alternately, you could
generalize make_directory to take an extra, optional argument that
specifies whether to throw if the directory already exists. Of
course, it should always throw if the error is something different
(e.g. if the parent directory doesn't exist).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk