Files
dotnet-runtime/src/libraries/System.IO.FileSystem
stephentoub 02007d2533 Add platform-agnostic case sensitivity detection
After the recent refactoring based on introducing native shims, the only reason there are special builds of System.IO.FileSystem and System.IO.FileSystem.DriveInfo for each of Linux and OS X is because of PathInternal.CaseSensitive/CaseInsensitive.cs, which just provides a hard-coded value as to whether the target platform is case-sensitive or case-insensitive-but-preserving.  Similarly, these files are the only things forcing System.IO.Compression.ZipFile to not be completely platform-agnostic and to have separate Windows/Unix builds.

This commit recombines those assemblies by adding a platform-agnostic helper that simply creates a temporary file with upper-case letters and then checks whether that file can be found via the lower-cased version.  This isn't perfect, in that it's possible to mount multiple file systems each with different case sensitivities, but a) it's better than the hardcoded version we currently have, and b) I don't know of any better portable solution.

(Issue dotnet/corefx#3156 tracks adding an API to provide information on case sensitivity.  This change can be replaced by using such an API if/when it's available.)


Commit migrated from https://github.com/dotnet/corefx/commit/62ba788d4730be24cff0ff0432f43bcc7b9e4561
2015-09-22 12:35:47 -04:00
..