Boost logo

Boost :

From: Victor A. Wagner, Jr. (vawjr_at_[hidden])
Date: 2002-08-04 03:11:14


I believe ignoring any possible error return from "os::remove()" to be
unacceptable and would change your specification to:
At Sunday 2002/08/04 00:04, you wrote:
>The conversation on this subject appears to be revolving around the
>implementation and not the specification.
>
>In my opinion , remove should be idempotent and therefore the
>specification ( but not the implementation ) should be :
>
>
>if ( exists( ph ) )
>{
> if ( is_directory( ph ) && ! empty( ph ) )
> throw
> else
> os::remove( ph )
replace the above line with:
          if (!(os::remove(ph)) throw
>}
>if ( exists( ph ) )
> throw
>
>
>where exists( ph ) is specified as :
>
>if ph definitely exists
> return true ;
>else if ph definitely does not exist
> return false ;
>else
> throw ;
>
>
>This is a valid specification which meets all the objections about wanting
>to be sure that the file has been deleted while still meeting the ease of
>use criteria that I believe is important for a portable filesystem. I
>accept that it may not be possible to efficiently implement this
>specification on any particular operating system.
>
>
>Keith Burton
>

Victor A. Wagner Jr. http://rudbek.com
PGP RSA fingerprint = 4D20 EBF6 0101 B069 3817 8DBF C846 E47A
PGP D-H fingerprint = 98BC 65E3 1A19 43EC 3908 65B9 F755 E6F4 63BB 9D93
The five most dangerous words in the English language:
               "There oughta be a law"



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