[llvm-commits] [llvm] r89765 - in /llvm/trunk: include/llvm/System/Path.h lib/System/Unix/Path.inc lib/System/Win32/Path.inc

Óscar Fuentes ofv at wanadoo.es
Tue Nov 24 14:32:49 PST 2009


"Edward O'Callaghan"
<eocallaghan at auroraux.org> writes:

[snip]

>> Windows does have special files AFAIK, for example opening "nul"
>> gives the effect of /dev/null on unix systems.
>
> OK, then I don't know the details of this nor do I have a windows
> machine to expand on this hook.
> Are you able to provide some more detail, is this bug a problem on
> windows as well?

On Windows you can't delete a NUL or any other device file name, even
when you are the Administrator user. A different issue is if clang barfs
when it tries to delete the output file and the operation fails.

There are lots of special file names on Windows: NUL, COM1, COM2...,
LPT1, LPT2..., PRN, CON, AUX etc. A file name that contains one of those
names as the basename may be considered special too (NUL.cpp, for
instance).

There is a GetFileType Win32 API, but it takes a file handle, not a file
name, and obtaining the file handle on a correct way is tricky. For
instance, is the file can't be opened maybe is because it does not
exists, but another possibility is that it may be blocked or is a device
in use.

-- 
Óscar




More information about the llvm-commits mailing list