DocumentPicker copyToCacheDirectory clarification

Hi, I have a question about the copyToCacheDirectory option in DocumentPicker.

The description of the prop says:

if true, the picked file is copied to FileSystem.CacheDirectory,
which allows other Expo APIs to read the file immediately.

I don’t understand how that works. If the file is not copied to a cache directory first, the uri returned is the original file on the device. This means that, if I was to access that uri using other APIs (such as FileSystem) the file would be readily accessible because it already exists there.
If a file has to be copied to the cache first, the DocumentPicker might resolve with the cached file uri, but it may not have finished copying the file there by that time, which makes it not available to be read right away.

The description of the copyToCacheDirectory option however, suggests that this behavior is the other way around - which logically doesn’t make sense to me.

Can someone please clarify this to me ?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.