You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 16, 2019. It is now read-only.
If we wish to concat two files or replace content of one file by another, we have to cache the file content in JS context and then write the data to destination.
constfs=RNFetchBlob.fsfs.readFile(FILE_SRC,'base64').then((b64data)=>fs.appendFile(FILE_DEST,b64data,'base64')).then(()=>{console.log(`concated ${FILE_SRC} to ${FILE_DEST}`)})
This seems not efficient especially when the file is big, that cache will likely consume up the available memory.
Therefore, I think we should make writeStream, writeFile, and appendFile accept a file path as their input, and then we can do as follow.
constfs=RNFetchBlob.fsfs.appendFile(FILE_DEST,FILE_SRC,'uri').then(()=>{console.log(`concated ${FILE_SRC} to ${FILE_DEST}`)})
Add uri encoding type to writeFile
Add uri encoding type to appendFile
Test cases
The text was updated successfully, but these errors were encountered:
Consider the following scenario
If we wish to concat two files or replace content of one file by another, we have to cache the file content in JS context and then write the data to destination.
This seems not efficient especially when the file is big, that cache will likely consume up the available memory.
Therefore, I think we should make
writeStream
,writeFile
, andappendFile
accept a file path as their input, and then we can do as follow.uri
encoding type towriteFile
uri
encoding type toappendFile
The text was updated successfully, but these errors were encountered: