Alex Rivera | Logout

How can I obtain the case-sensitive path on Windows?

Asked 2011-01-21T19:49:10.707
43

I need to know which is the real path of a given path.

For example:

The real path is: d:\src\File.txt
And the user give me: D:\src\file.txt
I need as a result: d:\src\File.txt

Edit
Report

1 Answer

-3

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 call FindFirstFile() with the path as a mask, then take the full name of the found file. If the path is invalid, then you won't get a canonical name, natually.

answered 2011-01-21T19:53:56.280

Your Answer