Windows保留名称"c on";解决方法/黑客 [英] Windows reserved name "c​on" workaround / hack

查看:108
本文介绍了Windows保留名称"c on";解决方法/黑客的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解"con"在Windows中是保留名称,但是是否存在注册表黑客或其他可以让我使用它的东西?

I understand that "con" is a reserved name in Windows, but is there a registry hack or something that will allow me to use it?

我在Windows 7上,试图解压缩包含名为"con.java"的文件的Java项目.每次都会失败.

I'm on Windows 7 and trying to unzip a java project containing a file named "con.java". It fails every time.

据我了解,Windows 7中不再使用"con".

From what I've learned, "con" is no longer used in Windows 7.

推荐答案

您可以通过调用Unicode版本的CreateFile(CreateFileW)并在路径前添加\\?\来创建具有保留名称的文件.在Java中,您可能需要JNI或类似的工具来执行此操作,或者找到一个代表您执行此操作的库.

You can create files with reserved names by calling the Unicode version of CreateFile (CreateFileW) and prepending \\?\ to the path. From Java you'd probably need JNI or similar to do that, or find a library that does that on your behalf.

但是,请记住,使用大多数其他应用程序认为保留的名称创建文件可能会导致互操作性问题.

However, keep in mind that creating files with names most other applications consider reserved will likely cause interoperability problems.

这篇关于Windows保留名称"c on";解决方法/黑客的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆