As a follow-up to #5219 we should re-implement the platform-specific filesystem primitives, as they have multiple issues in their current form.
We could upstream a patch to a popular library, like react-native-fs to expose synchronous variants of the functions we use.