当前位置: 首页 > news >正文

Windows 10 四月更新,文件夹名称也能区分大小写?

Windows 向来是不区分文件和文件夹大小写的,但是从 NTFS 开始却又支持区分文件夹大小写。而 Linux/Mac OS 一向都是区分文件和文件夹大小写的。

本文将推荐 Windows 10 四月更新带来的新特性——让文件夹名称也能区分大小写。


本来文件系统是否区分大小写只是单纯风格上的差异,并没有孰优孰劣,但这可让那些跨平台的文件系统难以抉择了。典型的例子就是 Git。

我曾经就遭遇过 Git 操作上的大小写敏感性问题,写了一篇博客:解决 Git 重命名时遇到的大小写不敏感的问题。

由于 Windows 文件系统对大小写不敏感,所以上面的问题才变得尤其难办,竟然需要通过至少两次提交,并且丢掉单线的 Git 历史记录的方式才能真正完成任务。而单纯让 Git 在仓库中区分大小写竟然会产生两份文件(却无法在 Windows 系统中观察到)。

于是,Windows 10 四月更新终于带来了文件夹区分大小写的支持!

fsutil.exe file SetCaseSensitiveInfo C:\Users\walterlv\GitDemo enable

是的,就是上面这一段非常简单而容易理解的命令即可开启单个文件夹的名称区分大小写功能。只是单个文件夹!如果需要开启其他文件夹,需要多次执行这样的命令。

而如果需要关闭对此文件夹的大小写支持,只需要将 enable 改为 disable

fsutil.exe file SetCaseSensitiveInfo C:\Users\walterlv\GitDemo disable

看!以上就是在 Windows 10 系统级开启了大小写敏感的我的一个 Git 仓库,这下可以让跨平台的 Git 工作起来在各个系统都一样了。


fsutil file 支持的命令:

 ⚡ lvyi@walterlv.github.io> fsutil.exe file
---- FILE Commands Supported ----

createNew                Creates a new file of a specified size
findBySID                Find a file by security identifier
layout                   Query all the information available about the file
optimizeMetadata         Optimize metadata for a file
queryAllocRanges         Query the allocated ranges for a file
queryCaseSensitiveInfo   Query the case sensitive information for a directory
queryExtents             Query the extents for a file
queryExtentsAndRefCounts Query the extents and their corresponding refcounts for a file
queryFileID              Queries the file ID of the specified file
queryFileNameById        Displays a random link name for the file ID
queryOptimizeMetadata    Query the optimize metadata state for a file
queryValidData           Queries the valid data length for a file
setCaseSensitiveInfo     Set the case sensitive information for a directory
setShortName             Set the short name for a file
setValidData             Set the valid data length for a file
setZeroData              Set the zero data for a file
setEOF                   Sets the end of file for an existing file
setStrictlySequential    Sets ReFS SMR file as strictly sequential

fsutil 支持的命令:

 ⚡ lvyi@walterlv.github.io> fsutil.exe
---- Commands Supported ----

8dot3name       8dot3name management
behavior        Control file system behavior
dax             Dax volume management
dirty           Manage volume dirty bit
file            File specific commands
fsInfo          File system information
hardlink        Hardlink management
objectID        Object ID management
quota           Quota management
repair          Self healing management
reparsePoint    Reparse point management
resource        Transactional Resource Manager management
sparse          Sparse file control
tiering         Storage tiering property management
transaction     Transaction management
usn             USN management
volume          Volume management
wim             Transparent wim hosting management

相关文章:

  • WPF 中使用附加属性,将任意 UI 元素或控件裁剪成圆形(椭圆)
  • XML 的 XPath 语法
  • .NET 使用 XPath 来读写 XML 文件
  • 像黑客一样!Chrome 完全键盘操作指南(原生快捷键 + Vimium 插件)
  • 如何在 .NET 库的代码中判断当前程序运行在 Debug 下还是 Release 下
  • 在制作跨平台的 NuGet 工具包时,如何将工具(exe/dll)的所有依赖一并放入包中
  • WPF 使用 WindowChrome,在自定义窗口标题栏的同时最大程度保留原生窗口样式(类似 UWP/Chrome)
  • 理解 Roslyn 中的红绿树(Red-Green Trees)
  • (1/2) 为了理解 UWP 的启动流程,我从零开始创建了一个 UWP 程序
  • (2/2) 为了理解 UWP 的启动流程,我从零开始创建了一个 UWP 程序
  • .NET/C# 使窗口永不获得焦点
  • .NET/C# 使用 SpanT 为字符串处理提升性能
  • WPF 应用完全模拟 UWP 的标题栏按钮
  • 让控制台支持 ANSI 转义序列,输出下划线、修改颜色或其他控制
  • 在 GitHub 公开仓库中隐藏自己的私人邮箱地址
  • 「译」Node.js Streams 基础
  • 11111111
  • 77. Combinations
  • C学习-枚举(九)
  • Git 使用集
  • JS进阶 - JS 、JS-Web-API与DOM、BOM
  • MySQL-事务管理(基础)
  • Node项目之评分系统(二)- 数据库设计
  • SpringCloud集成分布式事务LCN (一)
  • 初探 Vue 生命周期和钩子函数
  • 分类模型——Logistics Regression
  • 关于字符编码你应该知道的事情
  • 开源中国专访:Chameleon原理首发,其它跨多端统一框架都是假的?
  • 聊聊springcloud的EurekaClientAutoConfiguration
  • 使用 Node.js 的 nodemailer 模块发送邮件(支持 QQ、163 等、支持附件)
  •  一套莫尔斯电报听写、翻译系统
  • 译自由幺半群
  • 在weex里面使用chart图表
  • Oracle Portal 11g Diagnostics using Remote Diagnostic Agent (RDA) [ID 1059805.
  • Prometheus VS InfluxDB
  • shell使用lftp连接ftp和sftp,并可以指定私钥
  • 如何在招聘中考核.NET架构师
  • ​你们这样子,耽误我的工作进度怎么办?
  • #我与Java虚拟机的故事#连载13:有这本书就够了
  • (2021|NIPS,扩散,无条件分数估计,条件分数估计)无分类器引导扩散
  • (51单片机)第五章-A/D和D/A工作原理-A/D
  • (Demo分享)利用原生JavaScript-随机数-实现做一个烟花案例
  • (Matalb时序预测)PSO-BP粒子群算法优化BP神经网络的多维时序回归预测
  • *Django中的Ajax 纯js的书写样式1
  • .NET Framework杂记
  • .NET框架类在ASP.NET中的使用(2) ——QA
  • /etc/fstab 只读无法修改的解决办法
  • [ABP实战开源项目]---ABP实时服务-通知系统.发布模式
  • [ajaxupload] - 上传文件同时附件参数值
  • [C#C++]类CLASS
  • [codeforces]Levko and Permutation
  • [Linux]——彻底学通权限
  • [Loadrunner参数化]一个文件输两列参数的取值
  • [MongoDB]------windos下的安装部署与基础使用
  • [office] 图文演示excel怎样给单元格添加下拉列表 #知识分享#经验分享