' *** Returns amount of avalable space on specified device (in kb) ...
Sub GetAvailableSpace (DeviceName As String) As Long
Dim ph as Phone
Dim sb As StringBuilder
sb.Initialize
' *** Returns: device_name: xxxK total, yyyyK used, zzzK available (block size nnnn)
ph.Shell("df | grep " & DeviceName, Null, sb, Null) ' *** Return free space of specified device only ...
If (sb.ToString <> "") Then Return Regex.Split("K available", Regex.Split(",", sb.ToString)(2))(0) Else Return -1
End Sub
' *** Returns true if the specified device is mounted, false if not ...
Sub GetDeviceAvailable (DeviceName As String) As Boolean
Dim sb As StringBuilder
sb.Initialize
ph.Shell("mount", Null, sb, Null)
Return (sb.ToString.IndexOf(DeviceName) > -1)
End Sub