无能的WinXP?

来源:互联网 发布:中国网络人才需求 编辑:程序博客网 时间:2024/05/01 14:44
发现这个最近在国外的论坛很热门,细看一下,发现真的很有趣。大家也可以试一试:

在WinXP系统里,新建一个文件或文件夹,然后将它命名为con试试。

你成功了吗?

当然是失败,不能成功的。

这真是个很有趣的现像。大名鼎鼎的微软出品的WinXP,竟然连新建个指定的文件夹也不行?这也太“无能”了吧?

原因是什么?看下面分解。

It's not that weird. 'con' is a reserved word from the old DOS days, simply meaning 'console'. If you wanted to create a new text file in DOS you could type 'copy con newfile.txt' meaning copy from the console to newfile.txt. This would let you type some lines and when you ended the file with ^Z (DOSish for 'end of file') you would have a file called newfile.txt containing whatever you wrote in the console. This is indeed still possible in the Windows XP console, and can you see what mess it would cause if you let files or folders have the name 'con'? What would 'copy con newfile.txt' then mean? BSOD?

其实这并不能怪WinXP。因为“con”在DOS时代就是一个预定字,它实际上就是指“console”。如果你想在DOS下新建一个文本文件,你可以使用以下命令:

copy con newfile.txt

用这个命令可以将你在console控制台下所打的内容通通保存到一个newfile.txt文本文件里。就算是在WinXP的CMD里,这个命令依然有效。所以试想一下,如果你可以将文件或文件夹命名为con,那当你使用

copy con newfile.txt

命令的时候,会发生什么事?死机?或者更严重的后果。

类似地,在WinXP系统下,你不能将文件或文件命名为以下名字:

CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.

原创粉丝点击