"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:[EMAIL PROTECTED] 
Sent: 04 March 2004 09:51
To: Iain McCoy
Cc: COOPER, Jonathan -Syntegra UK; [EMAIL PROTECTED]; 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 = new StreamReader("/etc/mtab");
> > 
> >           ArrayList stuff = new ArrayList();
> >           string[] fields;
> >           while ( (line = mtab.ReadLine()) != null )
> >           {
> >              fields = line.Split(new char[]{' '});
> >              if (fields[0] != "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] != "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

********************************************************************

_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to