Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2005-05-08 16:19:18


"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:006301c5540d$c2bfe0b0$6401a8c0_at_pdimov2...
> Beman Dawes wrote:
>> "Peter Dimov" <pdimov_at_[hidden]> wrote in message
>> news:012701c553ea$c2707610$6401a8c0_at_pdimov2...
>>> 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"
>
> !exists("foo") == !!(status("foo") & not_found_flag) == status("foo") &
> not_found_flag
>
> if( status("foo") & not_found_flag )
> {
> create_directory( "foo" );
> }
>
> I don't see your point, but I may be missing something.

My point is that if "foo" is a socket or some other non-directory,
non-streamable-file, entity, then classifying it as "not_found_flag" is very
misleading. Yet status() has to classify it as something. It isn't an error,
it isn't not found, it isn't a directory, and it isn't a file (or
streamable-file or whatever you call that.) None of the existing categories
fit. So a new "other" category would seem indicated.

--Beman


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