3
Public Function CheckProgram(sProg As String) As Boolean
7
iPos = InStr(sProg, " ")
8
If iPos Then sProg = Left(sProg, iPos - 1)
10
Shell "which " & sProg & " >/dev/null 2>&1" Wait
12
Return (Process.LastValue = 0)
16
Public Function GetDirectorySize(sPath As String) As Long
18
Dim sSize, sCommand As String
20
If Not Exist(sPath) Then Return 0
22
sCommand = "du -bs " & Shell$(PathHelper.ResolvePath(sPath))
24
Shell sCommand To sSize
26
Return CLong(Split(sSize, "\t")[0])
30
Public Function ResolvePath(sPath As String) As String
32
Dim sFullPath As String
34
If sPath Begins "~/" Then
38
sFullPath = User.Home &/ sPath
47
Public Function ScaleSize(Size As Long) As String
53
Dim iKB As Integer = 1024
54
Dim iMB As Integer = iKB * iKB
55
Dim iGB As Integer = iMB * iKB
57
If Size >= 0 And Size < iKB Then
62
Else If Size >= iKB And Size < iMB Then
65
RetVal = Round(Size / iKB, -2)
67
Else If Size >= iMB And Size < iGB Then
70
RetVal = Round(Size / iMB, -2)
72
Else If Size >= iGB Then
75
RetVal = Round(Size / iGB, -2)
84
Return Subst("&1 &2", RetVal, sPower)
b'\\ No newline at end of file'