Skip to content

Commit

Permalink
Fixes for removable devices like Usb Key
Browse files Browse the repository at this point in the history
  • Loading branch information
eloaders committed Jul 24, 2014
1 parent 0b782d6 commit 832cc99
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
32 changes: 20 additions & 12 deletions I-Nex/i-nex/.src/Disk_Drives.module
Original file line number Diff line number Diff line change
Expand Up @@ -138,28 +138,34 @@ Public Sub disks()
mount_widtch = Null
mount_point = Null
device_uuid = Null


If IsNull(Finfosys.ComboBox3.Text) = False Then
For i = 0 To Dir("/dev/disk/by-uuid/", "*", gb.File).Count - 1
With Stat("/dev/disk/by-uuid/" & Dir("/dev/disk/by-uuid/", "*")[i])
If .Link Like "*" & Replace(Finfosys.ComboBox3.Text, " ", " ") & "*" Then
device_uuid = Dir("/dev/disk/by-uuid/", "*")[i]
Endif
End With
Next
Endif

If Access("/proc/mounts", gb.Read) = True Then
MOUNTS_PROC = Open "/proc/mounts"
For Each MountsLine In MOUNTS_PROC.Lines
For i = 0 To Split(MountsLine, " ", "%%").Count - 1
If Split(MountsLine, " ", "%%")[i] Like "*" & Finfosys.ComboBox3.Text & "*" Then
mount_point = Split(MountsLine, " ", "%%")[1]
filesystem_type = Split(MountsLine, " ", "%%")[2]
mount_widtch = Split(MountsLine, " ", "%%")[3]
Endif
If Split(MountsLine, " ", "%%")[i] Like "*" & device_uuid & "*" Then
mount_point = Split(MountsLine, " ", "%%")[1]
filesystem_type = Split(MountsLine, " ", "%%")[2]
mount_widtch = Split(MountsLine, " ", "%%")[3]
If IsNull(Finfosys.ComboBox3.Text) = False Then
If Split(MountsLine, " ", "%%")[i] Like "*" & Finfosys.ComboBox3.Text & "*" Then
mount_point = Split(MountsLine, " ", "%%")[1]
filesystem_type = Split(MountsLine, " ", "%%")[2]
mount_widtch = Split(MountsLine, " ", "%%")[3]
Endif
If IsNull(device_uuid) = False Then
If Split(MountsLine, " ", "%%")[i] Like "*" & device_uuid & "*" Then
mount_point = Split(MountsLine, " ", "%%")[1]
filesystem_type = Split(MountsLine, " ", "%%")[2]
mount_widtch = Split(MountsLine, " ", "%%")[3]
Endif
Endif
Endif
Next
Next
Expand All @@ -170,8 +176,10 @@ Public Sub disks()
SWAPS_PROC = Open "/proc/swaps"
For Each SwapsLine In SWAPS_PROC.Lines
For i = 0 To Split(SwapsLine, " ", "%%").Count - 1
If Split(SwapsLine, " ", "%%")[i] Like "*" & Finfosys.ComboBox3.Text & "*" Then
check_swap = Replace(Split(SwapsLine, " ", "%%")[0], "/dev/", "")
If IsNull(Finfosys.ComboBox3.Text) = False Then
If Split(SwapsLine, " ", "%%")[i] Like "*" & Finfosys.ComboBox3.Text & "*" Then
check_swap = Replace(Split(SwapsLine, " ", "%%")[0], "/dev/", "")
Endif
Endif
Next
Next
Expand Down
5 changes: 4 additions & 1 deletion I-Nex/i-nex/.src/Finfosys.class
Original file line number Diff line number Diff line change
Expand Up @@ -850,12 +850,15 @@ Label134.Text = "Rq affinity: " & Disk_Drives.rq_affinity & "" ' rq_affinity
ProgressBar2.Value = 0
ProgressBar2.ToolTip = "Unknown"
Endif
If IsNull(ComboBox3.Text) = False Then
If Disk_Drives.check_swap Like "*" & ComboBox3.Text & "*" Then
Label48.Visible = True
Else
Label48.Visible = False
Endif

Else
Label48.Visible = False
Endif
TextBox48.Text = Disk_Drives.mount_point
TextBox52.Text = Disk_Drives.device_uuid
TextBox53.Text = Disk_Drives.mount_widtch
Expand Down

0 comments on commit 832cc99

Please sign in to comment.