比较奇怪的说,Windows XP Pro SP2里不会有这些名字的文件或文件夹:
con, nul, aux (无关大小写)
这是今天阅读JDK Doc的 Inhancement in Java I/O时发现的。摘抄如下:
The
顺便在百度知道 问了一下这个问题,不知道有达人知道详细否。刚问好,我又找到答案了,在《 Cannot Create Windows Folder Named Con》上,因为:"CON" and a number of other character strings are in fact reserved names that go back to the days of DOS and cannot be used to name folders or files.(“CON”以及还有很多字符串不能为文件或者文件夹命名,因为它们是DOS系统的保留名字。)
原文链接: http://docs.google.com/View?docID=dxc9v3h_1275vp3vtd&revision=_latest
con, nul, aux (无关大小写)
这是今天阅读JDK Doc的 Inhancement in Java I/O时发现的。摘抄如下:
The
File.isFile()
Windows implementation has been modified to always return
false
for reserved device names such as CON, NUL, AUX, LPT, etc. Previously it returned
true
, which customers considered a bug because it was inconsistent with behavior for devices on Unix.
File.isFile()
在Windows系统上的实现已经修改:如果是保留的驱动器名如CON, NUL, AUX, LPT等等这些,它将返回false,而以前的版本(6.0之前的JDK)有一个bug,会返回true,这点和UNIX系统上的表现有些不一样。
顺便在百度知道 问了一下这个问题,不知道有达人知道详细否。刚问好,我又找到答案了,在《 Cannot Create Windows Folder Named Con》上,因为:"CON" and a number of other character strings are in fact reserved names that go back to the days of DOS and cannot be used to name folders or files.(“CON”以及还有很多字符串不能为文件或者文件夹命名,因为它们是DOS系统的保留名字。)
原文链接: http://docs.google.com/View?docID=dxc9v3h_1275vp3vtd&revision=_latest