HI, All
I'm trying to use the code module https://www.b4x.com/android/forum/threads/disk-space-utils.47520/#content
But cannot identify the drive - the letter "C:\" cannot be found in the map keys:
Some magic ...
Any suggestion ?
I'm trying to use the code module https://www.b4x.com/android/forum/threads/disk-space-utils.47520/#content
B4X:
Sub AppStart (Form1 As Form, Args() As String)
'(ArrayList) [C:\, D:\, E:\, P:\, R:\]
'(MyMap) {C:\=126100873216, D:\=125829115904, E:\=104857595904, P:\=258932207616, R:\=104857595904}
'(MyMap) {C:\=30034104320, D:\=34107752448, E:\=20868218880, P:\=16199786496, R:\=20868218880}
'(MyMap) {C:\=30034104320, D:\=34107752448, E:\=20868218880, P:\=16199786496, R:\=20868218880}
'(MyMap) {C:\=96066768896, D:\=91721363456, E:\=83989377024, P:\=242732421120, R:\=83989377024}
Dim drive As String = File.DirData("").SubString2(0, 3)
Log("drive=" & drive)
Private TotalDrives As List
TotalDrives.Initialize
TotalDrives=DiskUtils.GetDrives
Log (TotalDrives)
Private TotalDriveCapacity As Map
TotalDriveCapacity.Initialize
TotalDriveCapacity=DiskUtils.GetDrivesCapacity
Log (TotalDriveCapacity)
Private TotalUsableSpace As Map
TotalUsableSpace.Initialize
TotalUsableSpace=DiskUtils.GetUsableSpace
Log (TotalUsableSpace)
Private TotalFreeSpace As Map
TotalFreeSpace.Initialize
TotalFreeSpace=DiskUtils.GetFreeSpace
Log(TotalFreeSpace)
Private Writable As Map
Writable.Initialize
Writable=DiskUtils.Writable
Private UsedSpace As Map
UsedSpace.Initialize
UsedSpace=DiskUtils.GetUsedSpace
Log(UsedSpace)
Log(TotalUsableSpace.ContainsKey(drive)) 'Always FALSE ?!
End Sub
But cannot identify the drive - the letter "C:\" cannot be found in the map keys:
Result::
Waiting for debugger to connect...
Program started.
drive=C:\
(ArrayList) [C:\, D:\, E:\, P:\, R:\]
(MyMap) {C:\=126100873216, D:\=125829115904, E:\=104857595904, P:\=258932207616, R:\=104857595904}
(MyMap) {C:\=30033149952, D:\=34108186624, E:\=20867784704, P:\=16199708672, R:\=20867784704}
(MyMap) {C:\=30033149952, D:\=34108186624, E:\=20867784704, P:\=16199708672, R:\=20867784704}
(MyMap) {C:\=96067723264, D:\=91720929280, E:\=83989811200, P:\=242732498944, R:\=83989811200}
false
Some magic ...
Any suggestion ?