Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2004-09-29 19:18:02


At 11:49 AM 9/29/2004, Angus Leeming wrote:
>Beman,
>
>I notice that the Windows implementation of exists() contains the line:
>
> if(::GetFileAttributesA( ph.string().c_str() ) == 0xFFFFFFFF)
>
>This contrasts with
>
> DWORD attributes = ::GetFileAttributesA(
> ph.native_directory_string().c_str() );
>
>in is_directory(). I wonder if there are any implications in using
>string() as opposed to native_file_string() here? It does appear that
>in most places you prefer to use the "native_" flavour when invoking
>system functions.

Because Windows treats '\' and '/' as equivalent in paths, and uses the
same syntax for file and directory paths, there is no functional difference
in the two forms.

For coding consistency, it might be better to use the "native_"
functions. But since we don't know if a file or directory is involved,
I'm inclined to favor the code as it now stands.

Thanks,

--Beman


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