I have code (at the end of this message) in a .cs file, compiled with mcs and csc on Windows XP. When compiled with either compiler the executable works on both runtimes (.Net and mono). However, the output is different.
Run under .Net:
------------------------
Disk: A:\
Disk: C:\
Disk: D:\
Disk: K:\
Disk: L:\
Disk: Q:\
Disk: T:\
Disk: U:\
Disk: X:\
c:\
Dir: c:\Compaq
Dir: c:\Config.Msi
Dir: c:\Documents and Settings
Dir: c:\Program Files
Dir: c:\RECYCLER
Dir: c:\System Volume Information
Dir: c:\WINNT
Basically the contents of the root c:\ drive
Run under mono:
--------------------------
Disk: A:\
Disk: C:\
c:\
>> a list of directories in the current directory rather than the root c:\ <<
Is this due to an incomplete feature, or am I missing something?
Thanks in advance,
Jon Cooper
------------------------ CODE in drives.cs ------------------------
using System;
using System.IO;
namespace test
{
class test
{
[STAThread]
static void Main(string[] args)
{
string[] s = Directory.GetLogicalDrives();
foreach(string drive in s)
Console.WriteLine("Disk: {0}",drive);
string mydrive = Console.ReadLine();
if(mydrive.Length != 0)
{
foreach(string d in Directory.GetDirectories(mydrive))
Console.WriteLine("Dir: {0}",d);
Console.Read(); //pause
}
}
}
}
********************************************************************
This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person
Thank you
Check us out at http://www.syntegra.com
********************************************************************
