[Mono-list] Platform comparison

Nick Berardi nberardi@zigamorph.com
Mon, 8 Mar 2004 12:23:49 -0500

Just as a side note something that I just tried.  You can save files with a
"." as the first char in Explorer, if you don't believe me just look at
TortoiseCVS, they do it with out a problem.  Or open notepad and save the
following with the quotes ".text" and it works fine no problem.

-----Original Message-----
From: mono-list-admin@lists.ximian.com
[mailto:mono-list-admin@lists.ximian.com] On Behalf Of Jonathan Gilbert
Sent: Tuesday, March 09, 2004 12:58 AM
To: mono-list@lists.ximian.com
Subject: RE: [Mono-list] Platform comparison

Actually, as I understand it, it doesn't do any transformation. It passes
/'s to the underlying filesystem API, because it is supported there.  Yes,
the Win32 API *does* support '/' as a path separator character (Explorer's
support for this is sketchy, though; Explorer has other problems as well,
such as not allowing you to rename a file so that it begins with a dot).
Note also that even in Windows, the framework has
System.IO.Path.AltDirectorySeparatorChar == '/'. I haven't investigate it,
but the framework documentation implies that Rotor sets this to "\\",
despite the fact that, to the best of my knowledge, "\\" is not supported
on Unix as it is a valid character within a pathname component! I quote
from the AltDirectorySeparatorChar MSDN article:

The character stored in this field cannot be in InvalidPathChars. This
field can be set to the same value as DirectorySeparatorChar.
AltDirectorySeparatorChar and DirectorySeparatorChar are both valid for
separating directory levels in a path string.

The value of this field is a backslash ('\') on Unix, and a slash ('/') on
Windows and Macintosh operating systems.


At 10:12 AM 08/03/2004 -0500, you wrote:
>Hi everybody I just wanted to weigh in on this subject.  I have found that
>in the MS .Net framework, it usually doesn't matter what slash character
>use, because the framework converts it.  Such as if you are in a HTTP URL
>the framework converts "\" to "/".  And if you are working with an IO
>namespace then it converts "/" to "\".  I don't know if Mono does this,
>because I am just starting to use Mono, but there should be some
>normalization in the framework so the programmer doesn't constantly have to
>check these kinds of things IMHO.
>-----Original Message-----
>From: mono-list-admin@lists.ximian.com
>[mailto:mono-list-admin@lists.ximian.com] On Behalf Of Rodolfo Campero
>Sent: Monday, March 08, 2004 10:00 AM
>To: jwezel@compumaster.de; mono-list@ximian.com
>Subject: RE: [Mono-list] Platform comparison
>Hi Jochen,
>Instead of hard-coding the separator char, you can use 
>I don't know any guideline, but in general if you are about to do something

>that you think is not platform-independent, search a bit because is almost 
>sure that there is a platform-independent way to do it.
>>From: "Jochen Wezel" <jwezel@compumaster.de>
>>To: <mono-list@ximian.com>
>>Subject: [Mono-list] Platform comparison
>>Date: Mon, 8 Mar 2004 14:37:41 +0100
>>Hello together!
>>Is there a comparison or guideline for the several platforms regarding
>>what we developers have to pay attention to?
>>For example, Linux uses "/" as directory separator char, Windows uses
>>"\", but what about Mac OS (X)?
>>Or maybe there are other points which are good to know?
>>Mono-list maillist  -  Mono-list@lists.ximian.com
>Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
>Mono-list maillist  -  Mono-list@lists.ximian.com
>Mono-list maillist  -  Mono-list@lists.ximian.com
Mono-list maillist  -  Mono-list@lists.ximian.com