Exemplo n.º 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));
 }
Exemplo n.º 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";
     }
 }
Exemplo n.º 3
0
 private UnixDriveInfo(Native.Fstab fstab)
 {
     FromFstab(fstab);
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }