A Alessandra Pellegri Active Member Licensed User Longtime User Sep 3, 2015 #1 How could I retrieve free space on disk ? Thank you
Erel B4X founder Staff member Licensed User Longtime User Sep 3, 2015 #2 You can use this code: B4X: #if OBjC - (long long)freeDiskSpace { return [[[[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:nil] objectForKey:NSFileSystemFreeSize] longLongValue]; } #end if B4X: Dim no As NativeObject = Me Log(no.RunMethod("freeDiskSpace", Null).AsNumber) Upvote 0
You can use this code: B4X: #if OBjC - (long long)freeDiskSpace { return [[[[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:nil] objectForKey:NSFileSystemFreeSize] longLongValue]; } #end if B4X: Dim no As NativeObject = Me Log(no.RunMethod("freeDiskSpace", Null).AsNumber)
A Alessandra Pellegri Active Member Licensed User Longtime User Sep 3, 2015 #3 Solved!! Thank you Upvote 0