FileSystem Android Overwrite with same filename does not produce expected results

Hi guys!

This is a c/p form expo/github issues. Honestly, just trying to find fix/ideas for this. Thanks in advance!


expo: 25
“react”: “16.2.0”,
“react-native”: “”,

Steps to Reproduce

(First off, thank you for your time!)

Expo FileSystem in android does not show the most current file.

(Write your steps here:)

At componentDidMount FileSystem.makeDirectoryAsync(FileSystem.documentDirectory + ‘photobooth’)
At a function it uses camera.takePictureAsync() and then uses FileSystem.moveAsync to the directory above and append a filename (ie. ‘photoBoothImage_0.jpg’, ‘photoBoothImage_1.jpg’, …photoBoothImage_${n}.jpg)
In another screen after displaying (n) total pictures and sharing, we use (with an onPress) FileSystem.deleteAsync(FileSystem.documentDirectory + ‘photobooth’, {idempotent: true})
Expected Behavior

(Write what you thought would happen.)

Specifically for a photo booth session cycle. Concept is to take take (n) pictures, show the pictures taken, then present it to the user to be used however they want. Then, repeat flawlessly. =D

SideNote: works perfectly in iOS. Works the first time in Android, but the subsequent files shown are erratic at best, while most of the time it just shows the (supposedly) deleted files. We are guessing it has something to do with Android/Java async file(filename) overwrite/delete? Because at times some new images do show up. Again, works like a charm in iOS. Ideas?

Actual Behavior

(Write what happened. Add screenshots!)

Works the first time (Android). It does make the directory, saves the taken (n) pictures and displays it for the user. But, the next photobooth session it does not show the most current pictures taken.

Reproducible Demo

(Quick and dirty snack. Focus more on FS not the Camera)
(Paste the link to an example project and exact instructions to reproduce the issue.)

Thank you again!

Hi @hskb10 thanks for using Expo! We will be tracking the issue here:

Sorry I don’t have an immediate response for how to solve your problem. But I hope in the near future we can resolve issues you are having.

Thanks you for your reply @jimmylee! Also, thank you all for your hard work.

1 Like

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