启用tim无法访问文件夹_如何在Windows 10上启用区分大小写的文件和文件夹名称...

启用tim无法访问文件夹

启用tim无法访问文件夹

Windows 10 now offers an optional case-sensitive file system, just like Linux and other UNIX-like operating systems. All Windows processes will handle case-sensitive files and folders properly if you enable this feature. In other words, they’ll see “file” and “File” as two separate files.

Windows 10现在提供了一个可选的区分大小写的文件系统,就像Linux和其他类似UNIX的操作系统一样。 如果启用此功能,则所有Windows进程都会正确处理区分大小写的文件和文件夹。 换句话说,他们会将“文件”和“文件”视为两个单独的文件。

运作方式 (How This Works)

This is an NTFS file system feature that you can enable on a per-directory basis. It doesn’t apply to your entire file system, so you can just enable case sensitivity for specific folders you use for development purposes.

这是一个NTFS文件系统功能,可以按目录启用。 它不适用于整个文件系统,因此您可以为用于开发目的的特定文件夹启用区分大小写功能。

Case sensitivity was added in Windows 10’s April 2018 Update. Prior to this, it was possible to mount Windows folders as case sensitive within the Bash on Windows environment, also known as the Windows Subsystem for Linux. That worked fine within the Linux environment, but it confused normal Windows applications. This is now a file-system level feature, which means all Windows applications will see a case sensitive file system in that folder, too.

Windows 10的2018年4月更新中增加了区分大小写的功能 。 在此之前,可以在Windows环境中的Bash (也称为Linux的Windows子系统)中以区分大小写的方式安装Windows文件夹。 在Linux环境中可以正常工作,但会混淆普通的Windows应用程序。 现在,这是文件系统级别的功能,这意味着所有Windows应用程序也将在该文件夹中看到区分大小写的文件系统。

This feature is enabled via the fsutil.exe command, which you must run from the command line. You can do it from either a Command Prompt or PowerShell window. With the default settings, folders you create within the Linux environment are automatically configured to be case sensitive, as well.

通过fsutil.exe命令启用此功能,您必须从命令行运行该命令。 您可以从命令提示符或PowerShell窗口中进行操作。 使用默认设置,您在Linux环境中创建的文件夹也将自动配置为区分大小写。

如何将目录设置为区分大小写 (How to Set a Directory as Case Sensitive)

To get started, right-click the Start button, and then select the “PowerShell (Administrator)” command. If you prefer using the Command Prompt, you can search for “Command Prompt” in your Start menu, right-click it, and then select the “Run as Administrator” command. The command works the same, no matter which command-line environment you choose.

要开始使用,请右键单击“开始”按钮,然后选择“ PowerShell(Administrator)”命令。 如果您更喜欢使用命令提示符,则可以在“开始”菜单中搜索“命令提示符”,右键单击它,然后选择“以管理员身份运行”命令。 无论您选择哪种命令行环境,该命令的作用都相同。

You may not actually need Administrator access to run this command, depending on your permissions. Technically, you need the “write attributes” permission for the directory you want to modify. In most cases, this means that you’ll need Administrator permissions if you want to edit a folder somewhere outside your user folder—such as c:\project—-and not if you want to modify a folder somewhere inside your user folder—such as at c:\users\NAME\project.

根据您的权限,您实际上可能不需要管理员权限来运行此命令。 从技术上讲,您需要对要修改的目录具有“写入属性”权限。 在大多数情况下,这意味着如果您要编辑用户文件夹之外的某个文件夹(例如c:\ project),则需要管理员权限,而不是如果要修改用户文件夹内部的某个文件夹,则不需要管理员权限。如c:\ users \ NAME \ project。

Before continuing, be sure that no running Linux software is currently referencing the directory you’re about to modify. You should not change the case sensitivity flag on a folder while Linux software is accessing it. If any running Linux processes currently have the directory or anything inside the directory open, even as their current working directory, Linux applications won’t recognize the change and problems may occur.

在继续之前,请确保当前没有正在运行的Linux软件正在引用您要修改的目录。 在Linux软件访问文件夹时,请勿更改文件夹的区分大小写标志。 如果任何正在运行的Linux进程当前都打开了目录或目录中的任何内容,即使它们处于当前工作目录,Linux应用程序也将无法识别更改,并且可能会出现问题。

To make a folder case sensitive, type the following command, replacing “C:\folder” with the path to the folder:

要使文件夹区分大小写,请键入以下命令,将“ C:\ folder”替换为文件夹的路径:

fsutil.exe file setCaseSensitiveInfo C:\folder enable

If the folder path has a space in it, enclose the whole path in quotation marks, like so:

如果文件夹路径中有空格,则将整个路径用引号引起来,如下所示:

fsutil.exe file setCaseSensitiveInfo "C:\my folder" enable

这不会影响子文件夹 (This Doesn’t Affect Subfolders)

The case sensitivity flag only affects the specific folder to which you apply it. It isn’t automatically inherited by that folder’s subfolders.

区分大小写标志仅会影响您将其应用到的特定文件夹。 该文件夹的子文件夹不会自动继承它。

In other words, if you have a folder named C:\folder and it has C:\folder\test and C:\folder\stuff subfolders inside it, simply making the C:\folder folder case sensitive wouldn’t also make the “test” and “stuff” subfolders inside it case sensitive. You’d need to run the appropriate fsutil command separately to make all three folders case sensitive.

换句话说,如果您有一个名为C:\ folder的文件夹,并且其中包含C:\ folder \ test和C:\ folder \ stuff子文件夹,那么仅使C:\ folder文件夹区分大小写也不会使其中的“ test”和“ stuff”子文件夹区分大小写。 您需要单独运行适当的fsutil命令,以使所有三个文件夹区分大小写。

Linux工具默认创建区分大小写的文件夹 (Linux Tools Create Case Sensitive Folders by Default)

Linux tools you run inside the Windows Subsystem for Linux (Bash shell) now create folders with the case sensitive flag set. So, whether you use the mkdir command to create a directory inside a Bash shell or a development tool does it for you, the created directory is automatically set as case sensitive—even if you create it on your mounted Windows file system.

现在,您可以在Windows子系统(Bash shell)中运行的Linux工具创建带有区分大小写标志的文件夹。 因此,无论您使用mkdir命令在Bash shell内创建目录还是使用开发工具为您创建目录,创建的目录都会自动设置为区分大小写,即使您在已安装的Windows文件系统上创建了目录也是如此。

Technically, this occurs because the DrvFs file system for the Linux environment uses the case=dir flag by default. The case=dir option sets the Linux environment to respect each directory’s NTFS flag, and to automatically set the case sensitivity flag on directories created from within the Linux environment. You can change this option in your wsl.conf file, if you like.

从技术上讲,这是因为默认 case=dir用于Linux环境的DrvFs文件系统使用case=dir标志。 case=dir选项将Linux环境设置为尊重每个目录的NTFS标志,并自动在从Linux环境中创建的目录上设置区分大小写标志。 如果愿意,可以在wsl.conf文件中更改此选项。

As long as you create folders from the Linux environment, they’re created with the proper case sensitivity settings and you never need to touch the fsutil.exe command.

只要您在Linux环境中创建文件夹,便会使用适当的区分大小写设置创建文件夹,而您无需触摸fsutil.exe命令。

如何检查目录是否区分大小写 (How to Check if a Directory is Case Sensitive)

To check whether a directory is currently case sensitive, run the following command, replacing “C:\folder” with the path to the folder.

要检查目录当前是否区分大小写,请运行以下命令,将“ C:\ folder”替换为文件夹的路径。

fsutil.exe file queryCaseSensitiveInfo C:\folder

If case sensitivity is enabled for a directory, you’ll see that the “Case sensitive attribute on directory [path] is enabled.” If the directory is using the standard Windows case insensitivity, you’ll see that the “Case sensitive attribute on directory [path] is disabled.”

如果为目录启用了区分大小写,您将看到“目录[path]上的区分大小写属性已启用。” 如果目录使用标准的Windows不区分大小写,则将看到“目录[path]上的区分大小写属性已禁用。”

如何使目录不区分大小写 (How to Make a Directory Case Insensitive)

To undo your change and make a directory case insensitive once again (as Bill Gates intended it), run the following command, replacing “C:\folder” with the path to the folder.

要撤消更改并使目录再次不区分大小写(如Bill Gates所期望的),请运行以下命令,将“ C:\ folder”替换为文件夹的路径。

fsutil.exe file setCaseSensitiveInfo C:\folder disable

If you try to disable case sensitivity for a folder that contains files with names that would collide, you’ll see an “Error: The directory is not empty” message. You’ll need to remove or rename the conflicting files before continuing.

如果您尝试为包含名称冲突的文件的文件夹禁用区分大小写,则会看到“错误:目录不为空”消息。 您需要先删除或重命名有冲突的文件,然后再继续。

翻译自: https://www.howtogeek.com/354220/how-to-enable-case-sensitive-folders-on-windows-10/

启用tim无法访问文件夹

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值