[Mono-list] Simple code - differences in output between mono &.Net
jonathan.cooper@syntegra.com
jonathan.cooper@syntegra.com
Thu, 4 Mar 2004 09:55:00 -0000
"this could be useful for writing [..] a disk management tool in C#."
Which was precisely my intention as a first "big" mono/GTK# app ;)
-----Original Message-----
From: Jonathan Stowe [mailto:gellyfish@gellyfish.com]=20
Sent: 04 March 2004 09:51
To: Iain McCoy
Cc: COOPER, Jonathan -Syntegra UK; nberardi@zigamorph.com; Mono-List
Subject: RE: [Mono-list] Simple code - differences in output between mono
&.Net
On Thu, 2004-03-04 at 09:39, Iain McCoy wrote:
> On Thu, 2004-03-04 at 03:13, Jonathan Stowe wrote:
> > StreamReader mtab =3D new StreamReader("/etc/mtab");
> >=20
> > ArrayList stuff =3D new ArrayList();
> > string[] fields;
> > while ( (line =3D mtab.ReadLine()) !=3D null )
> > {
> > fields =3D line.Split(new char[]{' '});
> > if (fields[0] !=3D "none")
> > {
> > stuff.Add(fields[1]);
> > }
> > }
> What happens to /proc and /proc/bus/usb with this system?
They are explicitly skipped as a result of the 'fields[0] !=3D "none"' - if=
of
course you wanted then in there then you could just remove that condition.
As has been pointed out this is probably not vaery useful as a
GetLogicalDrives on a Unix-like system. However it could be adapted to
(say) a GetMountedDrives() returning an array of MountedDrive structs - this
could be useful for writing 'df' or 'mount' or a disk management tool in C#.
/J\
********************************************************************
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
********************************************************************