Check free storage space with RNFetchBlob (VS. RNFS)?

I am currently working on a React-Native project using React-Native-FS ( RNFS ). It looks like the project is not actively supported and the RNFS devs recommend using React-Native-Fetch-Blob ( RNFetchBlob ). The latter seems to be satisfying (although FileSystem offers fewer features than RNFS) and loading ( fetch

) is easier.

However, I used RNFS getFSInfo()

to extract the amount of free disk space. RNFetchBlob recently released a function df()

that basically does the same thing. However, I don't have the same results:

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

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

      

What explains the difference between the two? Why is the last RNFetchBlob negative? There is no documentation regarding this RNFetchBlob.fs.df()

, and looking at the source did not help me determine the difference.

PS : I am using xcode emulator; the reason is that RNFS checks for the laptop and RNFetchBlob checks for the emulator ?

+3


source to share





All Articles