File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -748,20 +748,17 @@ + (void) getPathFromUri:(NSString *)uri completionHandler:(void(^)(NSString * pa
748
748
749
749
+(void ) df : (RCTResponseSenderBlock)callback
750
750
{
751
- uint64_t totalSpace = 0 ;
752
- uint64_t totalFreeSpace = 0 ;
753
751
NSError *error = nil ;
754
752
NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES );
755
753
NSDictionary *dictionary = [[NSFileManager defaultManager ] attributesOfFileSystemForPath: [paths lastObject ] error: &error];
756
754
757
755
if (dictionary) {
758
756
NSNumber *fileSystemSizeInBytes = [dictionary objectForKey: NSFileSystemSize ];
759
757
NSNumber *freeFileSystemSizeInBytes = [dictionary objectForKey: NSFileSystemFreeSize ];
760
- totalSpace = [fileSystemSizeInBytes unsignedLongLongValue ];
761
- totalFreeSpace = [freeFileSystemSizeInBytes unsignedLongLongValue ];
758
+
762
759
callback (@[[NSNull null ], @{
763
- @" free" : [ NSNumber numberWithUnsignedLongLong: totalFreeSpace] ,
764
- @" total" : [ NSNumber numberWithUnsignedLongLong: totalSpace] ,
760
+ @" free" : freeFileSystemSizeInBytes ,
761
+ @" total" : fileSystemSizeInBytes ,
765
762
}]);
766
763
} else {
767
764
callback (@[@" failed to get storage usage." ]);
You can’t perform that action at this time.
0 commit comments