[Mono-dev] System.IO.Path: inconsistent paths from Windows clients

Kornél Pál kornelpal at gmail.com
Mon Jun 26 12:10:37 EDT 2006


System.IO.Path is using native path naming conventions. This is the expected 
behaviour.

Anyway there are no drive letters on Linux so you cannot use either D:/ or 
D:\ at all on Linux.

System.IO.Path is intended to do platform specific path operations using 
platform independent methods.

I see no reason to use Windows paths on Linux as you cannot use them. If you 
want to process Windows paths on Linux without any relation to actual file 
system paths you have to implement your own funtionality. (You can use 
Mono's implementation as a reference.)

Kornél

----- Original Message ----- 
From: "subscription.sapi" <subscription.sapi at apsystems.it>
To: "Kornél Pál" <kornelpal at gmail.com>; <mono-devel-list at lists.ximian.com>
Sent: Monday, June 26, 2006 6:00 PM
Subject: R: [Mono-dev] System.IO.Path: inconsistent paths from Windows 
clients


We check this functionality with mono 1.1.15 on RedHat Enterprise AS4. If 
you used "D:/R&D/doc/jd/StandardJD.doc" (note the forward slash), 
System.IO.Path works well, but if you try "D:\R&D\doc\jd\StandardJD.doc",
Path.GetFileName, returns al path including drive and folders.
For MS.NET we means IIS + .NET Framework. We are on the way to port a big
Web application from [Microsoft Windows + IIS + .NET] to [Linux + Apache + 
Mono].

If you know of different behaviour for recent builds of the mono library, 
please tell me the date of the build.
Thank you.

Roberto Cazzato
A.P.Systems srl
via Milano 89/91, ang. via Cimarosa
20013 Magenta (MI)
Tel: +39 02 972261
Fax: +39 02 97226339
Mobile: +39 348 2200850
E-Mail: roberto.cazzato at apsystems.it
http://www.apsystems.it

-----Messaggio originale-----
Da: Kornél Pál [mailto:kornelpal at gmail.com]
Inviato: lunedì 26 giugno 2006 17.31
A: subscription.sapi; mono-devel-list at lists.ximian.com
Oggetto: Re: [Mono-dev] System.IO.Path: inconsistent paths from Windows 
clients

Hi,

I tried this with trunk from SVN and got the same result on MS.NET and Mono.
Mono 1.1.15 should be OK as well.

I think you are using a very old version.

Kornél

----- Original Message ----- 
From: "subscription.sapi" <subscription.sapi at apsystems.it>
To: <mono-devel-list at lists.ximian.com>
Sent: Monday, June 26, 2006 5:16 PM
Subject: [Mono-dev] System.IO.Path: inconsistent paths from Windows clients


I've different behavior in ms.net framework and mono framework when I
use methods in "System.IO.Path" class.

Test Case Description:

Microsoft .net framework:
Input path: D:\R&D\doc\jd\StandardJD.doc
Output path:
Path.GetFileName                               StandardJD.doc
Path.GetDirectoryName                       D:\R&D\doc\jd
Path.GetFileNameWithoutExtension      StandardJD
Path.GetPathRoot                              D:\

MONO:
Input path: D:\R&D\doc\jd\StandardJD.doc
Output path:
Path.GetFileName
D:\R&D\doc\jd\StandardJD.doc
Path.GetDirectoryName
Path.GetFileNameWithoutExtension      D:\R&D\doc\jd\StandardJD
Path.GetPathRoot

Thank you.




More information about the Mono-devel-list mailing list