Skip to content

Commit

Permalink
Add Calculate Free space in device
Browse files Browse the repository at this point in the history
  • Loading branch information
eloaders committed Jul 28, 2014
1 parent 71d5cc9 commit d468b86
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
13 changes: 9 additions & 4 deletions I-Nex/i-nex/.src/Disk_Drives.module
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ Public Sub get_informations()
Try rotational = Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/queue/rotational"), "\n", "")
Try rq_affinity = Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/queue/rq_affinity"), "\n", "")

Try real_size = ((Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/" & Finfosys.ComboBox3.Text & "/size"), "\n", "") / 1024000) / 2) & " GB"

Try real_size = CLong(Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/" & Finfosys.ComboBox3.Text & "/size"), "\n", "") * 512)
' Print Fix(real_size / 1024)
' Print Fix(real_size / 1024 / 1024)
Try max_ratio = Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/bdi/max_ratio"), "\n", "")
Try min_ratio = Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/bdi/min_ratio"), "\n", "")
Try stable_pages_required = Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/bdi/stable_pages_required"), "\n", "")

Shell "LC_ALL=C df | grep \"" & Finfosys.ComboBox3.Text & "\" | awk {'print $5'} | sed -n '1p'" Wait To used
Used = Replace(Replace(Used, "%", ""), "\n", "")

Logs("Get informations of Drives Done", Logger.Info)
disks()
End
Expand All @@ -134,11 +134,13 @@ Public Sub disks()
Dim SWAPS_PROC As File
Dim MountsLine As String
Dim SwapsLine As String
Dim FREE_SPACE As String
filesystem_type = Null
mount_widtch = Null
mount_point = Null
device_uuid = Null

FREE_SPACE = 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])
Expand Down Expand Up @@ -185,4 +187,7 @@ Public Sub disks()
Next
Close #SWAPS_PROC
Endif

Try FREE_SPACE = Fix(Dfree(mount_point) / 1024 / 1024)
Finfosys.Label248.Text = "Free: " & FREE_SPACE
End
13 changes: 10 additions & 3 deletions I-Nex/i-nex/.src/Finfosys.form
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@
Border = Border.Raised
}
{ !Label38 Label
Move(168,175,294,21)
Move(7,175,294,21)
#Public = True
#Translate = False
Font = Font["8"]
Expand Down Expand Up @@ -1281,7 +1281,7 @@
Border = Border.Raised
}
{ Label48 Label
Move(105,175,70,21)
Move(392,28,70,21)
#Translate = False
Visible = False
Font = Font["8,Bold"]
Expand Down Expand Up @@ -1385,7 +1385,7 @@
Border = Border.Raised
}
{ !Label39 Label
Move(7,175,161,21)
Move(301,28,161,21)
#Public = True
#Translate = False
Font = Font["8,Bold"]
Expand All @@ -1396,6 +1396,13 @@
Move(0,196,469,14)
Font = Font["8"]
}
{ Label248 Label
Move(301,175,161,21)
Font = Font["8"]
Padding = 3
Text = ("Label248")
Border = Border.Raised
}
Index = 5
Text = "System"
Picture = Picture["AppIcons/Finfosys/applications-system.png"]
Expand Down

0 comments on commit d468b86

Please sign in to comment.