Windows “reserves” certain file names and doesn’t let you use them anywhere. Forget calling a file “con.txt” or “aux.mp3”. This is all because of a choice made in 1974 and Microsoft’s thirst for eternal backwards compatibility.

Windows“保留”某些文件名,并且不允许您在任何地方使用它们。 忘记调用文件“ con.txt”或“ aux.mp3”。 这完全是由于1974年做出的选择以及Microsoft对永恒的向后兼容性的渴望。

您无法使用的文件名 (File Names You Can’t Use)

Microsoft provides an official list of reserved file names, and here they are:

Microsoft提供了保留文件名的正式列表,它们是:

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

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

Note that you can’t use these file names with any file extension. So you can’t name a file “con.txt”, “con.jpg”, “or “con.doc”. And Windows isn’t case sensitive, so it doesn’t matter whether it’s CON, con, or CoN—Windows won’t let you use that name.

请注意,您不能将这些文件名与任何文件扩展名一起使用。 因此,您无法将文件命名为“ con.txt”,“ con.jpg”或“ con.doc”。 而且Windows不区分大小写,因此无论是CON,con还是CoN都不重要-Windows不允许您使用该名称。

You can try it yourself. Try saving a file as “con.txt” or “lpt6.txt” in Notepad. Or try renaming any file to one of these names in File Explorer. Windows just won’t let you do it.

您可以自己尝试。 尝试在记事本中将文件另存为“ con.txt”或“ lpt6.txt”。 或者尝试在“文件资源管理器”中将任何文件重命名为这些名称之一。 Windows只是不允许您这样做。

Of course, Windows also restricts file names in other ways. You can’t use various special characters like the following in names, either. Consult Microsoft’s official documentation for more information.

当然,Windows还以其他方式限制文件名。 您也不能在名称中使用如下所示的各种特殊字符。 有关更多信息,请查阅Microsoft的官方文档 。

1974年发生了什么,我们为什么要关心? (What Happened in 1974, and Why Should We Care?)

It is 2018 and this error message is a mistake from 1974.This limitation, which is still found in the very latest Windows 10, dates back to BEFORE STAR WARS. This bug is as old as Watergate. pic.twitter.com/pPbkZiE57t

现在是2018年,此错误消息是1974年的一个错误。此限制仍然可以在最新的Windows 10中找到,其历史可以追溯到星战之前。 此错误与Watergate一样古老。 pic.twitter.com/pPbkZiE57t

— foone (@Foone) November 3, 2018

— foone(@Foone) 2018年11月3日

As @Foone recently explained on Twitter, this issue dates back to 1974. In UNIX, “everything is a file.” (The same is true in UNIX-like operating systems like Linux today.) Hardware devices were represented at special paths like /dev/lp0 for the first printer and /dev/tty for the console.

正如@Foone最近在Twitter上解释的那样,此问题可以追溯到1974年。在UNIX中 ,“ 一切都是文件” 。 (在今天的Linux之类的类似UNIX的操作系统中也是如此。)硬件设备在特殊路径中表示,例如第一台打印机的/ dev / lp0和控制台的/ dev / tty。

In 1974, this same concept was added to the CP/M operating system. Unfortunately, CP/M was designed for computers with very little memory and no hard drives. It used multiple disks and no directories, so those special files representing devices effectively appeared everywhere, on every disk.

1974年,将相同的概念添加到CP / M操作系统中。 不幸的是,CP / M是为内存很少且没有硬盘驱动器的计算机设计的。 它使用多个磁盘,没有目录,因此代表设备的那些特殊文件有效地出现在每个磁盘上的任何地方。

So, when you were saving a text file, you could tell your text editor to “save” it to the printer device, which would print it. But text editors and other programs like adding file extensions like “.txt”, so CP/M just ignored the file extension for these device files. In other words, if a text editor tries saving a file to the name of the printer device followed by “.txt”, CP/M just assumed it was referring to the printer device and ignored the file extension. Now the feature worked properly in every application—great!

因此,在保存文本文件时,您可以告诉文本编辑器将其“保存”到打印机设备,然后再进行打印。 但是文本编辑器和其他程序喜欢添加文件扩展名,例如“ .txt”,因此CP / M只是忽略了这些设备文件的文件扩展名。 换句话说,如果文本编辑器尝试将文件保存为打印机设备的名称,后跟“ .txt”,则CP / M只是假定它是在指打印机设备,而忽略了文件扩展名。 现在,该功能可以在每个应用程序中正常工作,很棒!

Sure, it’s a dirty hack, but who cares? Well, CP/M caught on. Eventually PC-DOS came along, and it kept that useful CP/M feature. PC-DOS 2.0 added directories back in 1983, but Microsoft chose to have these device files appear in all directories for compatibility with existing DOS software rather than place them in a special device folder.

当然,这是肮脏的骇客,但谁在乎呢? 好吧,CP / M很流行。 最终PC-DOS出现了,它保留了该有用的CP / M功能。 PC-DOS 2.0在1983年添加了目录,但是Microsoft选择让这些设备文件出现在所有目录中以与现有DOS软件兼容,而不是将它们放置在特殊的设备文件夹中。

Eventually, Windows 95 came along, and it was built on top of DOS. Windows NT wasn’t based on top of DOS, but it did want to be backwards compatible with Windows 95 applications. Windows 10 is still based on Windows NT, and it works the same way. The same applies on Windows 7, of course.

最终,Windows 95出现了,它是基于DOS构建的。 Windows NT并非基于DOS,但它确实希望与Windows 95应用程序向后兼容。 Windows 10仍基于Windows NT,并且工作方式相同。 当然,在Windows 7上也是如此。

Now, it’s over forty years later and we still can’t name files “con.txt” or “aux.mp3” because Windows wants to stay compatible with ancient programs that might be using this feature. It’s a good example of how intensely Microsoft is committed to backwards compatibility.

现在,已经有40年了,我们仍然不能命名文件“ con.txt”或“ aux.mp3”,因为Windows希望与可能正在使用此功能的古老程序保持兼容。 这是Microsoft致力于向后兼容的一个很好的例子。

翻译自: https://www.howtogeek.com/fyi/windows-10-still-wont-let-you-use-these-file-names-reserved-in-1974/

Windows 10仍然不允许您使用1974年保留的这些文件名相关推荐

  1. 计算机管理要继续请输入,Windows 10上提示UAC错误:如要继续请输入管理员密码!...

    在今天的文章中,我们将尝试解决UAC(用户访问控制)错误消息提示,您是否要使用以下程序对此计算机进行更改?要继续,请键入管理员密码,然后单击"是" –某些Windows 10用户在 ...

  2. Windows 10 中的恢复选项

    如果你的电脑有问题,下表可帮助你决定使用哪个恢复选项.有关黑屏或蓝屏错误的帮助,请参阅黑屏问题疑难解答或蓝屏错误疑难解答. 问题 请参阅本部分 你的电脑性能不佳,并且你最近安装了更新. 删除已安装的 ...

  3. Windows 10 1809 MSDN 版本下载 ed2k 链接

    ARM64位 企业版(包含企业版.教育版.专业版) Windows 10 (business edition), version 1809 (Updated Sept 2018) (ARM64) – ...

  4. Windows 10 1709 MSDN 版本下载 ed2k 链接

    64位 多版本(批量授权版) Windows 10 (multi-edition) VL, Version 1709 (Updated Sept 2017) (x64) – DVD (Chinese- ...

  5. Windows 10 1809和Office 2019下载(20190222更新)

    @TOC特别说明:本帖不提供任何密钥或激活方法,请大家也不要在帖内回复或讨论涉及版权的相关内容,仅提供原版ISO下载链接 一.20190222更新说明 更新1809版本2019年1月最新正式版本177 ...

  6. Windows 10下编译安装Hadoop2.6

    转自:https://www.linuxidc.com/Linux/2016-08/134131.htm Windows 10下安装Hadoop2.6,Windows10下编译64位Hadoop2.x ...

  7. mysql数据库解压安装教程_MySQL数据库之windows 10下解压版MySql安装配置方法教程...

    本文主要向大家介绍了MySQL数据库之windows 10下解压版MySql安装配置方法教程 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助. windows 10 下安装解压版的 ...

  8. w ndows连接USB不正常,Raspberry Pi Zero W 连接电脑 – 针对Windows 10 缺少RNDIS驱动

    在网上有很多关于Raspberry Pi Zero连接电脑的帖子,但是发现在windows 10 系统上发现没有发现RNDIS 驱动,这个驱动在其他系统上会自动安装,但是在windows 10 上显示 ...

  9. Windows 10完美识别3TB硬盘实录

    京东上买了一块3TB希捷酷鱼硬盘,已经安装到PC机箱中,操作系统是Windows 10. 启动Windows 10,进入操作系统,没有识别出该盘,系统也没有报错.为了让windows 10识别并格式化 ...

最新文章

  1. python数据池连接PG
  2. java poi 读取xlsx文件_使用POI读取xlsx文件(SXSSFWorkbook)
  3. UIWebView内存泄露问题解决方法
  4. 2018-2019-1 20165231 实验四 外设驱动程序设计
  5. python-greenlet模块(协程)
  6. CSS计数器(自定义列表)
  7. 小学四年级计算机制作月历教案,四年级上册信息技术教案-1制作月历|冀教版(5页)-原创力文档...
  8. 50以内的质数顺口溜_【停课不停学】学习妙招|小学数学学习中的顺口溜,记住了事半功倍!...
  9. 微信读书 iOS 性能优化总结
  10. 右下角任务栏弹出天猫广告的解决办法,搞了半天原来是搜狗拼音在捣鬼!附搜狗双拼党转投微软拼音怀抱教程
  11. Teamviewer解决许可证授权的问题
  12. 教你用Python自制一张好看的指数估值图!这招很好用!
  13. C#编程总结(四)多线程应用(进度条的编程问题)——转自http://www.cnblogs.com/yank/p/3232955.html...
  14. _itemmod_extract_enchant
  15. 互联网日报 | 7月14日 星期三 | 京东宣布涨薪两个月;腾讯收购搜狗股权获无条件批准;教育部辟谣取消教师寒暑假...
  16. python web论坛_十个基于Python的BBS论坛类开源web框架汇总(附源码地址)
  17. Extjs 中鼠标划过悬浮效果的显示
  18. 杂谈:区块链是否值得投资
  19. 聂文涛食物训练与现代医学的差异
  20. wordpress搭建

热门文章

  1. 30 minutes---tatu (From Lina)
  2. There is no known eureka server; cluster server list is empty
  3. 360 safe.php,防止网站被黑,增强网站安全文件:360_safe3.php-防SQL注入代码
  4. 观光(最短路求方案数2)
  5. ROS2机器人f1tenth之CLI工具基础
  6. NovelAI:AI作画二次元、续写故事,画师要失业?
  7. 《基于Unity与SteamVR构建虚拟世界》(Yanlz+Unity+XR+SteamVR+LeapMotion+Neuron+Kinect+IMU+Kickstarter+立钻哥哥++ok++)
  8. /usr/bin/xauth: file /home/name/.Xauthority does not exist
  9. 巨建华:对未来越有信心,对现在越有耐心 |链捕手
  10. 创业的经验50条(汇总)