Exemple #1
0
 public static UnixDriveInfo GetForSpecialFile(string specialFile)
 {
     if (specialFile == null)
     {
         throw new ArgumentNullException("specialFile");
     }
     Native.Fstab f = Native.Syscall.getfsspec(specialFile);
     if (f == null)
     {
         throw new ArgumentException("specialFile isn't valid: " + specialFile);
     }
     return(new UnixDriveInfo(f));
 }
Exemple #2
0
 public UnixDriveInfo(string mountPoint)
 {
     if (mountPoint == null)
     {
         throw new ArgumentNullException("mountPoint");
     }
     Native.Fstab fstab = Native.Syscall.getfsfile(mountPoint);
     if (fstab != null)
     {
         FromFstab(fstab);
     }
     else
     {
         this.mount_point  = mountPoint;
         this.block_device = "";
         this.fstype       = "Unknown";
     }
 }
Exemple #3
0
 private UnixDriveInfo(Native.Fstab fstab)
 {
     FromFstab(fstab);
 }
Exemple #4
0
 private void FromFstab(Native.Fstab fstab)
 {
     this.fstype       = fstab.fs_vfstype ?? String.Empty;
     this.mount_point  = fstab.fs_file ?? String.Empty;
     this.block_device = fstab.fs_spec ?? String.Empty;
 }
Exemple #5
0
 private void FromFstab(Native.Fstab fstab)
 {
     this.fstype       = fstab.fs_vfstype;
     this.mount_point  = fstab.fs_file;
     this.block_device = fstab.fs_spec;
 }