[filesystem] possible bug in exists(path const &)

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. Regards, Angus

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
participants (2)
-
Angus Leeming
-
Beman Dawes