Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2002-07-15 20:45:17


At 07:04 PM 7/15/2002, Tom Harris wrote:

>Two comments:
> Win32 calls are not prefixed by `::`, whereas the POSIX calls are,
>is there a reason for this?

With the Win32 calls, there is no chance of a reader mistaking a Win32 API
name for something else. With the POSIX implementation, namespace
boost::filesystem functions are sometimes implemented with POSIX functions
of the same name. Even when the compiler can keep the names straight, I
thought :: would make it clearer to the reader. That was the theory,
anyhow.

> The boost::filesystem::rename() function cannot move a directory to
>a different drive on Windows as it uses the ::MoveFile call. I think that
>the only way of doing this on Windows is to copy all files and
directories
>manually. Perhaps just document this limitation, rather than trying to
code
>workarounds. Apparently the POSIX rename() can also fail if the
directories
>are on different filesystems, but I am no POSIX expert and this might be
>hearsay.

Carl Daniel wrote:

>Files can be moved between filesystems on Win32 by using SHFileOperation
>instead of MoveFile. Personally, I'd rather have the limitation
documented
>& keep the filesystem library insulated from the shell API.

I think the three of us are in agreement that implementations should not
try to resuscitate an otherwise failing rename() by heroic efforts like
switching to a copy strategy. I've changed the docs to indicate this.

Thanks to both of you for your comments.

--Beman


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