[Mono-list] Determining case sensitive environments

Chris Capon ttabyss at gmail.com
Mon Dec 8 18:40:48 EST 2008

I'm building a cross platform application in .NET which uses regular
expressions for file pattern matching.  The application runs under Windows
and Linux (so far).

When comparing patterns with paths, the code needs to know whether the file
system expects filenames to be case insensitive (Windows) or if it expects
filenames to match exactly (Linux).

I'm trying to find the best way to tell if an environment is case sensitive
or not.

So far, all I have is the use of:


but because it has a variety of values to represent Windows, I'm concerned
that more might be introduced in the future - breaking my code.  Also, I'm
not sure if PlatformID.Unix is sufficient for something like the OS/X
environment which may be partially case insensitive.

Does anyone have a better way to determine case sensitivity?

I'd rather not create a file on the filesystem just to find out as this
introduces problems of its own.


View this message in context: http://www.nabble.com/Determining-case-sensitive-environments-tp20878432p20878432.html
Sent from the Mono - General mailing list archive at Nabble.com.

More information about the Mono-list mailing list