Answer by Simon Mourier for How can I obtain the case-sensitive path on Windows?
Here is how I do it. Originally, I used to depend on GetFinalPathNameByHandle which is very good, but unfortunately, some custom file systems don't support it (of course NTFS does). I also tried...
View ArticleAnswer by MLH for How can I obtain the case-sensitive path on Windows?
I tried to avoid dll imports so the best way for me was to use System.Linq and the System.IO.Directory class.For your exampleReal path is: d:\src\File.txtThe user give me: D:\src\file.txtCode for...
View ArticleAnswer by Yogi for How can I obtain the case-sensitive path on Windows?
Alternative SolutionHere is a solution that worked for me to move files between Windows and a server using case sensitive paths. It walks down the directory tree and corrects each entry with...
View ArticleAnswer by scobi for How can I obtain the case-sensitive path on Windows?
Here's an alternate solution, works on files and directories. Uses GetFinalPathNameByHandle, which is only supported for desktop apps on Vista/Server2008 or above according to docs.Note that it will...
View ArticleAnswer by Christoph for How can I obtain the case-sensitive path on Windows?
As Borja's answer does not work for volumes where 8.3 names are disabled, here the recursive implementation that Tergiver suggests (works for files and folders, as well as the files and folders of UNC...
View ArticleAnswer by Tergiver for How can I obtain the case-sensitive path on Windows?
As an old-timer, I always used FindFirstFile for this purpose. The .Net translation is:Directory.GetFiles(Path.GetDirectoryName(userSuppliedName),...
View ArticleAnswer by user541686 for How can I obtain the case-sensitive path on Windows?
The way to get the actual path of a file (this won't work for folders) is to follow these steps:Call CreateFileMapping to create a mapping for the file.Call GetMappedFileName to get the name of the...
View ArticleAnswer by Seva Alekseyev for How can I obtain the case-sensitive path on...
On Windows, paths are case-insensitive. So both paths are equally real.If you want to get some kind of a path with canonical capitalization (i. e. how Windows thinks it should be capitalized), you can...
View ArticleAnswer by Borja for How can I obtain the case-sensitive path on Windows?
You can use this function:[DllImport("kernel32.dll", SetLastError=true, CharSet=CharSet.Auto)]static extern uint GetLongPathName(string ShortPath, StringBuilder sb, int...
View ArticleHow can I obtain the case-sensitive path on Windows?
I need to know which is the real path of a given path.For example:The real path is: d:\src\File.txtAnd the user give me: D:\src\file.txtI need as a result: d:\src\File.txt
View Article
More Pages to Explore .....