Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2005-05-08 12:31:07


"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:012701c553ea$c2707610$6401a8c0_at_pdimov2...
> Beman Dawes wrote:
>
>> 1) Add an other_flag and a matching is_other() function. Change
>> definition of exists() to status() &
>> (directory_flag|file_flag|other_flag)
>
> An entity that is not file or directory should just return false from
> is_file and is_directory. There are no operations defined on "other", so
> the category and the corresponding predicate are useless.
>
> It seems to me that the correct definition of exists() in terms of
> status() is just !(status() & not_found_flag).

The expectation with not_found_flag is that, assuming the branch() if any is
found, it should be possible to create a file or directory with that path.
Consider:

   if (!exists("foo"))
      create_directory("foo"); // surprise! This may fail: "exists but not
a directory"

That seems pretty strange to me.

--Beman


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