Closed mitchdowney closed 2 years ago
Yes, looks like the same problem as #52 hits these other APIs as well.
Can you try react-native-file-access@beta
? One key difference is if you are using a scoped storage uri, you must use AndroidScoped.appendPath(dir, 'data.txt')
instead of dir + '/data.txt'
when generating paths.
It's working! 🥳 thanks so much for the quick fix!
react-native: 0.66.1 react-native-file-access: 2.4.4 Platform: Android 11
Bug I can't seem to delete files from scoped storage on an external SD card.
I'm trying to delete a file in scoped storage with:
await FileSystem.unlink('content://com.android.externalstorage.documents/tree/01F6-AC3F%3APodverse/document/01F6-AC3F%3APodverse/D9_Zc6_nz.mp3')
But I get the error message:
I get the same error message when I call:
await FileSystem.stat('content://com.android.externalstorage.documents/tree/01F6-AC3F%3APodverse/document/01F6-AC3F%3APodverse/D9_Zc6_nz.mp3')
@alpha0010 just fixed a different issue with calling
await FileSystem.cp(...)
with SD card scoped storage. Could there be corresponding fixes needed for stat and deleteFile?I have also tried deleting these files with
react-native-fs
andreact-native-scoped-storage
. react-native-fs failed to delete the file because of an access issue. react-native-scoped-storage has a different bug where it deletes the whole directory instead of the file specified 🤦♂️