3

I am currently working on a React-Native project using React-Native-FS (RNFS). It appears that the project is not actively maintained and the developers of RNFS recommend to use React-Native-Fetch-Blob (RNFetchBlob). The latter is kind of satisfying (even though the FileSystem is offers less features than RNFS) and the downloading (fetch) is more simple.

However, I was using RNFS's getFSInfo() to retrieve the amount of free space on disk. Recently, RNFetchBlob released the df() feature that basically does the same. However, I do not have the same results :

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

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

What does explain the difference between the two ? Why is RNFetchBlob's last value a negative one ? There is no documentation relative to RNFetchBlob.fs.df() and looking at the source code didn't help me to spot the difference.

PS: I am using xcode's emulator; the reason could be that RNFS checks on laptop storage and RNFetchBlob checks on emulator's ?

Val Berthe
  • 1,899
  • 1
  • 18
  • 33

0 Answers0