You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/10/20 09:08:59 UTC

[GitHub] [cordova-plugin-file] LightMind commented on issue #364: Large file save freeze app for seconds

LightMind commented on issue #364:
URL: https://github.com/apache/cordova-plugin-file/issues/364#issuecomment-947474745


   @raphinesse Thank you so much, I really appreciate it :)
   
   I am also a little bit worried about changing the behaviour of `FileWriter` to always use chunks, because it can potentially give problems with partial writes. Writing to a file feels to me like something that should be atomic, if possible.
   
   This makes me unsure about if or how to continue https://github.com/apache/cordova-plugin-file/pull/461
   
   Would it be reasonable to provide a `ChunkedFileWriter` ( And maybe a `ChunkedFileReader` )? It could implement the chunked writing behaviour on top of `FileWriter`.
   
   Something like 
   
   ```
   fileEntry.createWriter(async (fileWriter) => {
       var chunkedWriter = new ChunkedFileWriter(fileWriter)
       chunkedWriter.setChunkSize(2 ** 15)
   
       chunkedWriter.onwriteend = function()
       ...
                     
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org