This repository was archived by the owner on Mar 16, 2019. It is now read-only.
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 @@ -758,20 +758,17 @@ + (void) getPathFromUri:(NSString *)uri completionHandler:(void(^)(NSString * pa
758
758
759
759
+(void ) df : (RCTResponseSenderBlock)callback
760
760
{
761
- uint64_t totalSpace = 0 ;
762
- uint64_t totalFreeSpace = 0 ;
763
761
NSError *error = nil ;
764
762
NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES );
765
763
NSDictionary *dictionary = [[NSFileManager defaultManager ] attributesOfFileSystemForPath: [paths lastObject ] error: &error];
766
764
767
765
if (dictionary) {
768
766
NSNumber *fileSystemSizeInBytes = [dictionary objectForKey: NSFileSystemSize ];
769
767
NSNumber *freeFileSystemSizeInBytes = [dictionary objectForKey: NSFileSystemFreeSize ];
770
- totalSpace = [fileSystemSizeInBytes unsignedLongLongValue ];
771
- totalFreeSpace = [freeFileSystemSizeInBytes unsignedLongLongValue ];
768
+
772
769
callback (@[[NSNull null ], @{
773
- @" free" : [ NSNumber numberWithUnsignedLongLong: totalFreeSpace] ,
774
- @" total" : [ NSNumber numberWithUnsignedLongLong: totalSpace] ,
770
+ @" free" : freeFileSystemSizeInBytes ,
771
+ @" total" : fileSystemSizeInBytes ,
775
772
}]);
776
773
} else {
777
774
callback (@[@" failed to get storage usage." ]);
You can’t perform that action at this time.
0 commit comments