[Mono-list] Is it the intended behavious?
A Rafael D Teixeira
rafaelteixeirabr@hotmail.com
Sun, 25 Aug 2002 14:38:43 -0300
>From: Hans-Jürgen Schönig <mono@cybertec.at>
>Reply-To: hs@cybertec.at
>To: mono-list@ximian.com
>Subject: [Mono-list] Is it the intended behavious?
>Date: Sun, 25 Aug 2002 19:06:50 +0200
>
>I have written a small test application:
>
>using System;
>using System.IO;
>
>public class Demo
>{
> public static void Main(string[] args)
> {
> if (args.Length > 0)
> {
> DirectoryInfo data = new DirectoryInfo(args[0]);
> Console.WriteLine("Name: " + data.Name);
> Console.WriteLine("Name vollstaenig: "
> + data.FullName);
> Console.WriteLine("Attribute: "
> + data.Attributes);
> Console.WriteLine("Vater: " + data.Parent);
> Console.WriteLine("Wurzel: " + data.Root);
> Console.WriteLine("Erstellt am: "
> + data.CreationTime);
> Console.WriteLine("Letzter Zugriff: "
> + data.LastAccessTime);
> Console.WriteLine("Letzter Schreibzugriff: "
> + data.LastWriteTime);
> }
> }
>}
>
>When running the application the behaviour seems to be strange.
>Is it the intented behavious? (watch the slashes):
>
>[hs@duron io]$ mono file.exe /usr/local/src/
>Name: /usr/local/src/
>Attribute: Directory
>Vater: /usr/local/src
>Wurzel: /
>Erstellt am: 02/06/1996 21:04:01
>Letzter Zugriff: 08/25/2002 02:05:44
>Letzter Schreibzugriff: 02/06/1996 21:04:01
>[hs@duron io]$ vi file.cs
>[hs@duron io]$ mono file.exe /usr/local/src
>Name: /usr/local/src
>Attribute: Directory
>Vater: /usr/local
>Wurzel: /
>Erstellt am: 02/06/1996 21:04:01
>Letzter Zugriff: 08/25/2002 02:05:44
>Letzter Schreibzugriff: 02/06/1996 21:04:01
>
>Is it a bug or a feature?
>Unfortunately I don't have the chance to test it on Window$.
>
> Hans
Run on my Win2000 system on csc/ms.net:
C:\cygwin\tmp\ConsoleApplication1\bin\Debug>consoleapplication1 .
Name: Debug
Name vollstaenig: C:\cygwin\tmp\ConsoleApplication1\bin\Debug
Attribute: Directory
Vater: bin
Wurzel: C:\
Erstellt am: 25/8/2002 14:18:04
Letzter Zugriff: 25/8/2002 14:28:01
Letzter Schreibzugriff: 25/8/2002 14:18:35
There seems to have a difference on what the Parent (Vater) member returns,
please fill a bugzilla...
The Root (Wurzel) member is correctly returning the / dir, because Linux
does not have the drive letter concept.
About slashes versus backslashes, you have to verify what is valid for the
platform, through System.IO.Path.DirectorySeparatorChar.
Hope it helps...
Rafael Teixeira
Brazilian Polymath
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com