[Mono-list] Simple code - differences in output between mono & .Net
Nick Berardi
nberardi@zigamorph.com
Wed, 3 Mar 2004 09:51:59 -0500
This is a multi-part message in MIME format.
------=_NextPart_000_0036_01C40105.2CC1D020
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Maybe NTFS defines partitions differently? Or maybe for some reason Mono is
hard coded to see the two common drives on every windows box. It definitely
is weird though. I would submit it as a bug.
_____
From: jonathan.cooper@syntegra.com [mailto:jonathan.cooper@syntegra.com]
Sent: Wednesday, March 03, 2004 9:43 AM
To: nberardi@zigamorph.com
Subject: RE: [Mono-list] Simple code - differences in output between mono &
.Net
the strange thing is, D:\ is a partition on the same disk as C:\, and Q:\ is
the CDROM....
-----Original Message-----
From: Nick Berardi [mailto:nberardi@zigamorph.com]
Sent: 03 March 2004 14:41
To: COOPER, Jonathan -Syntegra UK
Subject: RE: [Mono-list] Simple code - differences in output between mono &
.Net
It looks like mono doesn't look for non-network drives. That is a little
weird. The mono one should out put the same data as the .Net one so it is
probably a bug in Mono
_____
From: mono-list-admin@lists.ximian.com
[mailto:mono-list-admin@lists.ximian.com] On Behalf Of
jonathan.cooper@syntegra.com
Sent: Wednesday, March 03, 2004 9:32 AM
To: mono-list@lists.ximian.com
Subject: [Mono-list] Simple code - differences in output between mono & .Net
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
********************************************************************
********************************************************************
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
********************************************************************
------=_NextPart_000_0036_01C40105.2CC1D020
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Message</title>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"place"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman";}
code
{font-family:"Courier New";}
span.EmailStyle19
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Maybe NTFS defines partitions
differently? Or maybe for some reason Mono is hard coded to see =
the two
common drives on every windows box. It definitely is weird =
though.
I would submit it as a bug.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font =
size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>
<hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1>
</span></font></div>
<p class=3DMsoNormal><b><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font =
size=3D2
face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'>
jonathan.cooper@syntegra.com [mailto:jonathan.cooper@syntegra.com] <br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Wednesday, March =
03, 2004
9:43 AM<br>
<b><span style=3D'font-weight:bold'>To:</span></b> <st1:PersonName =
w:st=3D"on">nberardi@zigamorph.com</st1:PersonName><br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> RE: [Mono-list] =
Simple
code - differences in output between mono & =
.Net</span></font><o:p></o:p></p>
</div>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div>
<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:blue'>the strange thing is, D:\ is a =
partition
on the same disk as C:\, and Q:\ is the =
CDROM....</span></font><o:p></o:p></p>
</div>
<blockquote =
style=3D'margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'>
<p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original =
Message-----<br>
<b><span style=3D'font-weight:bold'>From:</span></b> Nick Berardi =
[mailto:<st1:PersonName
w:st=3D"on">nberardi@zigamorph.com</st1:PersonName>] <br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> 03 March 2004 =
14:41<br>
<b><span style=3D'font-weight:bold'>To:</span></b> COOPER, Jonathan =
-Syntegra UK<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> RE: [Mono-list] =
Simple
code - differences in output between mono & =
.Net</span></font><o:p></o:p></p>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>It looks like mono doesn’t =
look for
non-network drives. That is a little weird. The mono one =
should out
put the same data as the .Net one so it is probably a bug in =
Mono<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font =
size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>
<hr size=3D2 width=3D"100%" align=3Dcenter tabIndex=3D-1>
</span></font></div>
<p class=3DMsoNormal><b><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font =
size=3D2
face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'> =
mono-list-admin@lists.ximian.com
[mailto:mono-list-admin@lists.ximian.com] <b><span =
style=3D'font-weight:bold'>On
Behalf Of </span></b>jonathan.cooper@syntegra.com<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Wednesday, March =
03, 2004
9:32 AM<br>
<b><span style=3D'font-weight:bold'>To:</span></b> =
mono-list@lists.ximian.com<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> [Mono-list] =
Simple code -
differences in output between mono & =
.Net</span></font><o:p></o:p></p>
</div>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>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.</span></font><o:p></o:p></p>
<p><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Run
under .Net:</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>------------------------</sp=
an></font>
<br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Disk:
A:\</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Disk:
C:\</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Disk:
D:\</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Disk:
K:\</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Disk:
L:\</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Disk:
Q:\</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Disk:
T:\</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Disk:
U:\</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Disk:
X:\</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>c:\</span></font>
<br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Dir:
c:\Compaq</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Dir:
c:\Config.Msi</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Dir:
c:\Documents and Settings</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Dir:
c:\Program Files</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Dir:
c:\RECYCLER</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Dir:
c:\System Volume Information</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Dir:
c:\WINNT</span></font> <o:p></o:p></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Basically
the contents of the root c:\ drive</span></font> <o:p></o:p></p>
<p><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Run
under mono:</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>--------------------------</=
span></font>
<br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Disk:
A:\</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Disk:
C:\</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>c:\</span></font>
<br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>>>
a list of directories in the current directory rather than the root c:\
<<</span></font> <o:p></o:p></p>
<p><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Is
this due to an incomplete feature, or am I missing =
something?</span></font> <o:p></o:p></p>
<p><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Thanks
in advance,</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Jon
Cooper</span></font> <o:p></o:p></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>------------------------
CODE in drives.cs ------------------------</span></font> <o:p></o:p></p>
<p><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>using
System;</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>using
System.IO;</span></font> <o:p></o:p></p>
<p><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>namespace
test</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>{ </span></font><br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>
class test</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>
{</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> &nbs=
p;
[STAThread]</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> &nbs=
p;
static void <st1:place w:st=3D"on">Main</st1:place>(string[] args) =
</span></font><br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> &nbs=
p;
{</span></font> <br>
<font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> string[] s =3D
Directory.GetLogicalDrives();</span></font> <br>
<font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> foreach(string drive in =
s)</span></font>
<br>
<font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>
Console.WriteLine("Disk: {0}",drive);</span></font> =
<o:p></o:p></p>
<p><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'> &nbs=
p;</span></font><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> string
mydrive =3D Console.ReadLine();</span></font> <o:p></o:p></p>
<p><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'> &nbs=
p;</span></font><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> if(mydrive.Length
!=3D 0)</span></font> <br>
<font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> {</span></font> <br>
<font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> foreach(string =
d in
Directory.GetDirectories(mydrive))</span></font> <br>
<font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> &nbs=
p;
Console.WriteLine("Dir: {0}",d);</span></font> =
<o:p></o:p></p>
<p><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'>
</span></font><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:
Arial'> Console.Read(); //pause</span></font> <br>
<font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> }</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> &nbs=
p;
}</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>
}</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>}</span></font>
<o:p></o:p></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Courier New"><span =
style=3D'font-size:12.0pt;
font-family:"Courier New"'><br>
<br>
</span></font><code><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>*****************************************************************=
***</span></font></code><font
face=3D"Courier New"><span style=3D'font-family:"Courier New"'><br>
<br>
</span></font><code><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>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</span></font></code><font =
face=3D"Courier New"><span
style=3D'font-family:"Courier New"'><br>
</span></font><code><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>Thank you</span></font></code><font face=3D"Courier New"><span
style=3D'font-family:"Courier New"'><br>
<br>
</span></font><code><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>Check us out at =
http://www.syntegra.com</span></font></code><font
face=3D"Courier New"><span style=3D'font-family:"Courier New"'><br>
<br>
</span></font><code><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>*****************************************************************=
***</span></font></code><o:p></o:p></p>
</blockquote>
<p class=3DMsoNormal><font size=3D3 face=3D"Courier New"><span =
style=3D'font-size:12.0pt;
font-family:"Courier New"'><br>
<br>
<code><font face=3D"Courier =
New">********************************************************************=
</font></code><br>
<br>
<code><font face=3D"Courier New">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</font></code><br>
<code><font face=3D"Courier New">Thank you</font></code><br>
<br>
<code><font face=3D"Courier New">Check us out at =
http://www.syntegra.com</font></code><br>
<br>
<code><font face=3D"Courier =
New">********************************************************************=
</font></code></span></font><o:p></o:p></p>
</div>
</body>
</html>
------=_NextPart_000_0036_01C40105.2CC1D020--