Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit 623afc3

Browse files
wkh237bcpclone
authored andcommitted
Apply fix to #302 IOS fs.df issue
1 parent 1f15176 commit 623afc3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ios/RNFetchBlobFS.m

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -758,20 +758,17 @@ + (void) getPathFromUri:(NSString *)uri completionHandler:(void(^)(NSString * pa
758758

759759
+(void) df:(RCTResponseSenderBlock)callback
760760
{
761-
uint64_t totalSpace = 0;
762-
uint64_t totalFreeSpace = 0;
763761
NSError *error = nil;
764762
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
765763
NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] error: &error];
766764

767765
if (dictionary) {
768766
NSNumber *fileSystemSizeInBytes = [dictionary objectForKey: NSFileSystemSize];
769767
NSNumber *freeFileSystemSizeInBytes = [dictionary objectForKey:NSFileSystemFreeSize];
770-
totalSpace = [fileSystemSizeInBytes unsignedLongLongValue];
771-
totalFreeSpace = [freeFileSystemSizeInBytes unsignedLongLongValue];
768+
772769
callback(@[[NSNull null], @{
773-
@"free" : [NSNumber numberWithUnsignedLongLong: totalFreeSpace],
774-
@"total" : [NSNumber numberWithUnsignedLongLong: totalSpace],
770+
@"free" : freeFileSystemSizeInBytes,
771+
@"total" : fileSystemSizeInBytes,
775772
}]);
776773
} else {
777774
callback(@[@"failed to get storage usage."]);

0 commit comments

Comments
 (0)