- static StreamReader TryOpen (string name)
- {
- if (File.Exists (name))
- return new StreamReader (name, Encoding.ASCII);
- return null;
- }
-
- static DriveInfo [] LinuxGetDrives ()
- {
- using (StreamReader mounts = TryOpen ("/proc/mounts")){
- ArrayList drives = new ArrayList ();
- string line;
-
- while ((line = mounts.ReadLine ()) != null){
- if (line.StartsWith ("rootfs"))
- continue;
- int p;
-
- p = line.IndexOf (' ');
- if (p == -1)
- continue;
- string rest = line.Substring (p+1);
- p = rest.IndexOf (' ');
- if (p == -1)
- continue;
- string path = rest.Substring (0, p);
- rest = rest.Substring (p+1);
- p = rest.IndexOf (' ');
- if (p == -1)
- continue;
- string fstype = rest.Substring (0, p);
- drives.Add (new DriveInfo (_DriveType.Linux, path, fstype));
- }
-
- return (DriveInfo []) drives.ToArray (typeof (DriveInfo));
- }
- }
-
- static DriveInfo [] UnixGetDrives ()
+ [MonoTODO("In windows, alldrives are 'Fixed'")]
+ public static DriveInfo[] GetDrives ()