Skip to content

Instantly share code, notes, and snippets.

@mechazod
Last active May 7, 2020 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mechazod/04519cb9f33b509fea17a10c7092fa91 to your computer and use it in GitHub Desktop.
Save mechazod/04519cb9f33b509fea17a10c7092fa91 to your computer and use it in GitHub Desktop.
Get React Native Available Disk Space
// ios
RNFetchBlob.fs.df().then( response => {
console.log('Free space in bytes: ' + response.free);
console.log('Total space in bytes: ' + response.total);
});
// android
RNFetchBlob.fs.df().then( response => {
console.log('External free space in bytes: ' + response.external_free);
console.log('External total space in bytes: ' + response.external_total);
console.log('Internal free space in bytes: ' + response.internal_free);
console.log('Internal total space in bytes: ' + response.internal_total);
});
Source:
https://stackoverflow.com/questions/41799211/checking-for-available-disk-space-in-react-native
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment