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

[QUESTION] How to use RNFetchBlob.fs.df() ? #302

Closed
ValBerthe opened this issue Mar 30, 2017 · 7 comments
Closed

[QUESTION] How to use RNFetchBlob.fs.df() ? #302

ValBerthe opened this issue Mar 30, 2017 · 7 comments

Comments

@ValBerthe
Copy link

ValBerthe commented Mar 30, 2017

Using react-native-fetch-blob 0.10.2
Using xcode and iPhone 6S emulator, iOS 10.2
Using react-native 0.42


I am working on a project using RNFS, but since they recommend to use RNFetchBlob, I'm going to refactor everything. Among other features, I'm using RNFS's getFSInfo() in order to retrieve free storage space left. So, as 0.10.0 introduced df(), I would like to know how it works (wiki section is empty).

I have those noticeable differences :

// RNFS
{
  totalSpace: 248828264448 (~ 248 GBytes)
  freeSpace: 216244088832 (~ 216 GBytes)
}

// RNFetchBlob
{
  free: 1495726032 (~ 1.5 GBytes)
  total: -279838720 (~ -279 MBytes)
}

Why those differences ? Is it a matter of emulator's storage/laptop storage ? Why is RNFetchBlob's total a negative number ?

@ValBerthe ValBerthe changed the title How to use RNFetchBlob.fs.df() ? [QUESTION] How to use RNFetchBlob.fs.df() ? Mar 30, 2017
@wkh237
Copy link
Owner

wkh237 commented Mar 30, 2017

@ValBerthe , we've fixed the issue #276 but not yet release to npm. You can try to install the package from branch issue-276 and see if it's working properly, thanks!

@ValBerthe
Copy link
Author

ValBerthe commented Apr 5, 2017

Updated to RNFetchBlob 0.10.4.

df() seems to still have a weird behavior.

// RNFetchBlob
{
  free: -796413952 (~ -796 MBytes)
  total: -279838720 (~ -279 MBytes)
}

wkh237 added a commit that referenced this issue Apr 5, 2017
@wkh237
Copy link
Owner

wkh237 commented Apr 5, 2017

@ValBerthe , I have committed a fix to branch issue-301, please try to install the package from the branch and see if that works.

wkh237 added a commit that referenced this issue Apr 5, 2017
@ValBerthe
Copy link
Author

@wkh237 Updated RNFetchBlob 0.10.4#issue-301 :

Output is

{
  free: 492335104 (~ 492 MBytes)
  total: -279838720 (~ -279 MBytes)
}

Free space seems better, even though it is not the same value as expected by RNFS. Total space is still the same.

wkh237 added a commit that referenced this issue Apr 5, 2017
@wkh237
Copy link
Owner

wkh237 commented Apr 5, 2017

@ValBerthe , thanks for quick response. I've just changed the implementation, you can install the package again from the same branch issue-302` now 👍

@ValBerthe
Copy link
Author

@wkh237 Updated RNFetchBlob 0.10.4#issue-302 :

The output is the same as previously. Have you managed to run a working version of the feature ? Are freeFileSystemSizeInBytes and fileSystemSizeInBytes accurate enough ?

I'll check this out myself when I have a minute.

@wkh237
Copy link
Owner

wkh237 commented Apr 14, 2017

@ValBerthe , I can only test it on the simulator but the result looks to make sense.

image

Not sure if I missed something ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants