Getting actual file name (with proper casing) on Windows

前端 未结 7 1000
暗喜
暗喜 2020-12-05 19:29

Windows file system is case insensitive. How, given a file/folder name (e.g. \"somefile\"), I get the actual name of that file/folder (e.g. it should return \"SomeF

7条回答
  •  春和景丽
    2020-12-05 20:10

    FindFirstFileNameW will work with a few drawbacks:

    • it doesn't work on UNC paths
    • it strips the drive letter so you need to add it back
    • if there are more than one hard link to your file you need to identify the right one

提交回复
热议问题