http://llvm.org/bugs/show_bug.cgi?id=8520
Summary: Win32/Path.inc: "NUL" is not regular file (clang -o
NUL fails)
Product: libraries
Version: trunk
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P
Component: System Library
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
C:\path\to> clang foo.c -S -o nul
error: unable to rename temporary 'nul-000000' to output file 'nul': 'Can't
move
'nul-000000' to 'nul': Cannot create a file when that file already
exists.
'
1 error generated.
clang: error: unable to remove file:
===
It is due to sys::Path::isRegularFile().
My workaround is below. It seems there is no way to detect
reserved filenames ("nul", "con", &c) with Win32API.
--- a/lib/System/Win32/Path.inc
+++ b/lib/System/Win32/Path.inc
@@ -369,6 +369,9 @@ bool
Path::isRegularFile() const {
if (isDirectory())
return false;
+ if (getBasename().size() == 3
+ && memcmp(getBasename().data(), "nul", 3) == 0)
+ return false;
return true;
}
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs