birdofpreyru / react-native-fs

File system access for React Native
https://dr.pogodin.studio/docs/react-native-file-system
Other
121 stars 8 forks source link

[iOS/macOS] Files outside the sandbox, picked by `pickFile()`, can't be accessed by other library methods #28

Open birdofpreyru opened 5 months ago

birdofpreyru commented 5 months ago

More precisely, in case of macOS this is true for files outside the app sandbox, for iOS it applies for files from iCloud. The problem is that current conversion of security-scoped URLs into string URLs returned by pickFile() looses the security-scope permissions.

birdofpreyru commented 5 months ago

As of v2.23.0 the issue is fixed for pickFile(), copyFile(), and exists(). Other functions, most probably, require additional fixes to correctly handle the special «Bookmark URLs» returned now by pickFile() on iOS & macOS (in the absence of these fixes other methods are not expected to crash in any dramatic way, most probably they'll just consider such URLs point to non-existing files).

birdofpreyru commented 2 weeks ago

Since v2.27.1 «Bookmark URLs» are, presumably, supported by readDir() and readdir() methods (implemented, pending to be tested).