internal static FileSystem[] GetDrives() { List <FileSystem> allDrives = new List <FileSystem>(); UnixDriveInfo[] drives = UnixDriveInfo.GetDrives(); foreach (UnixDriveInfo udi in drives) { // We exclude some irrelevant (pseudo)filesystems /*if(udi.DriveFormat == "proc" || udi.DriveFormat == "sysfs" || udi.DriveFormat == "debugfs" || udi.DriveFormat == "devpts" || udi.DriveFormat == "procfs") || continue;*/ FileSystem sd = new FileSystem(); sd.MountPoint = udi.Name; sd.OriginalMountPoint = udi.Name; //sd.Name = udi.VolumeLabel; sd.Size = udi.TotalSize; sd.AvailableFreeSpace = udi.AvailableFreeSpace; sd.Path = udi.VolumeLabel; //sd.Path = udi.Name; sd.DriveFormat = udi.DriveFormat; //sd.DriveType = (DriveType)udi.DriveType; try{ sd.SnapshotType = FilesystemManager.GetDriveSnapshotType(sd.MountPoint); } catch {} allDrives.Add(sd); } return(allDrives.ToArray()); }
internal static FileSystem[] GetDrives() { List <FileSystem> allDrives = new List <FileSystem>(); DriveInfo[] drives = DriveInfo.GetDrives(); foreach (DriveInfo wdi in drives) { try{ FileSystem sd = new FileSystem(); sd.MountPoint = wdi.Name; sd.OriginalMountPoint = wdi.Name; sd.Size = wdi.TotalSize; sd.AvailableFreeSpace = wdi.AvailableFreeSpace; sd.Path = wdi.VolumeLabel; sd.DriveFormat = wdi.DriveFormat; sd.Label = wdi.VolumeLabel; //sd.DriveType = wdi.DriveType; try{ sd.SnapshotType = FilesystemManager.GetDriveSnapshotType(sd.MountPoint); allDrives.Add(sd); } catch {} } catch {} // dirve not ready windows error } return(allDrives.ToArray()); }