Re: Path-related asserts

"Charlie Poole" <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nunit.devel
Message-ID <006201c874fb$02fc94a0$6401a8c0@ferrari>
Hi Daniel,

Nope, it's not a dead horse - just a very esoteric one. :-)

I'm concluding that the best way to specify case sensitivity
is to specify it directly on the call, rather than using the
OS name as a standin. And I agree that the default should
be non-case-sensitive unless we learn more.

It would be interesting to see what happens in Mono when accessing
an NT file system as well.

Charlie 

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On 
> Behalf Of Daniel M. Pomerantz
> Sent: Thursday, February 21, 2008 2:37 PM
> To: Charlie Poole
> Cc: [email protected]
> Subject: Re: [nunit-developer] Path-related asserts
> 
> To continue down the path (no pun intended) of case 
> sensitivity in paths in .Net, I came across the following 
> while doing some work for my job.  
> Thought it applied and should be shared:
> 
> In the .Net 2.0 and 3.5 MSDN documentations, I found the 
> following blurb related to System.IO.Directory.Exists(string 
> path) and System.IO.Directory.Delete(string path):
> 
> "The path parameter is not case-sensitive."
> 
> System.IO.Directory.CreateDirectory(string path), 
> System.IO.File.Create, System.IO.File.Exists, and 
> System.IO.File.Delete have no such blurb in their 
> documentation.  This leads me to believe that Microsoft 
> envisioned .Net to always be case preserving on the creation 
> of directories, but always case insensitive in working with 
> directories.....which leaves me to believe that as per the 
> documentation, the path / directory asserts that we have 
> discussed should always be case-insensitive regardless of the 
> OS or the FS in play.  Please note that I am not saying that 
> I agree with this implementation, but to me, documentation is gospel.
> 
> I am curious for how this is implemented on OSes and FSes 
> which are case sensitive.  When running mono on a linux box, 
> accessing an ext3 fs, if the directories /etc/foo/bar and 
> /etc/FOO exist, what what will be the result of calling 
> Directory.Exists("/etc/FOO/bar")?  What will happen if some 
> one calls "Directory.Delete("/etc/foo", true)" ?  I feel that 
> this needs to be resolved...by the mono team.
> 
> This is all made even more complicated by the fact that File 
> doesn't have the blurb, and paths are a completely different 
> animal:  Directory and File are meant to actually interact 
> with a FS, and Path is all intended to be theoretical.  In 
> looking at the documentation for Path a bit closer, I found 
> no case specific data, but did find the following:  
> "Because all these operations are performed on strings, it is 
> impossible to verify that the results are valid in all scenarios."
> 
> My (hopefully final) thoughts on the matter:
> 
> This should be clarified with Microsoft.  The documentation 
> and intent 
> in this area is not clear:   Are all or no paths case sensitive?
> 
> NUnit should pick a standard and use it throughout.  The 
> objects at the heart of this appear to either be ambiguous or 
> documented as case insensitive.  That leads me to believe 
> that the best way to adhere to the documentation is to be 
> case insensitive.
> 
> If NUnit wishes to have an option, I can understand, but the 
> default behaviour of the framework (case in-sensitivity) 
> should be the default behaviour of the Asserts. 
> 
> Sorry if these appears to be beating a dead horse or 
> repeating already stated opinions, I just thought that this 
> shed a new light on the matter.
> 
> dmp
> 
> 
> --------------------------------------------------------------
> -----------
> This SF.net email is sponsored by: Microsoft Defy all 
> challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> nunit-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nunit-developer
> 



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.