Skip to content

Add API to get actual file casing in path #14321

Open
@ellismg

Description

@ellismg

Per @jasonwilliams200OK in dotnet/coreclr#390

Based on this answer: http://stackoverflow.com/a/81493/1712065 (further redirected from: http://stackoverflow.com/a/326153).

Please add the ability to retrieve path with actual case via FileInfo and DirectoryInfo classes. The candidate member being FullPath and Name. Perhaps there is some sophisticated way of getting it from win32 file system API, but that seems to be a working solution.

Expected:

using System.IO.FileInfo;
// ..
// actual path was:
// C:\\SharePoint\\scripts\\MasterDeployment.ps1
FileInfo info = new FileInfo("c:\\sharepoint\\scriPts\\maSTerdeploymnet.PS1");
Console.WriteLine(info.FullPath);
// C:\\SharePoint\\scripts\\MasterDeployment.ps1
Console.WriteLine(info.Name);
// MasterDeployment.ps1

Actual result:

using System.IO.FileInfo;
// ..
// actual path was:
// C:\\SharePoint\\scripts\\MasterDeployment.ps1
FileInfo info = new FileInfo("c:\\sharepoint\\scriPts\\maSTerdeploymnet.PS1");
Console.WriteLine(info.FullPath);
// c:\\sharepoint\\scriPts\\maSTerdeploymnet.PS1
Console.WriteLine(info.Name);
// maSTerdeploymnet.PS1

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-System.IO

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions