Windows系统没有的文件或文件夹

比较奇怪的说,Windows XP Pro SP2里不会有这些名字的文件或文件夹:
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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值