ammarahm-ed / react-native-scoped-storage

MIT License
58 stars 10 forks source link

Unexpeted behaviour while writting to a file #37

Open M4RC3L05 opened 2 years ago

M4RC3L05 commented 2 years ago

Hi,

There seems to be a issue writing to already existing files when the text to be written is smaller that the text that already exists on the file.

For example, with the mode currently in use w, let there be a file called foo.txt with the text foobar; If we try to write to that file, the string foo, there wont be any changes in the file contents, the content will still be foobar.

Now with the mode wt, the file contents now change to be foo as expected.

This was only tested on android 12 but I believe this behavior happens for android 10+ has the following link states.