' *** 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