itinance / itinance/react-native-fs

CameraRoll not respecting new date/time after touch

Open
#451 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

I'm using `react-native-fs` to download a remote video file and touch to modify the files created/modified date. After that, I'm saving the video to the CameraRoll. The video is saving successfully, but it's not respecting the new created/modified date. If I download a video created a week ago, it's showing as a week old in the CameraRoll (even though the created/modified dates are set to today).

It looks like touch is working properly, as the console log after calling `stat` is showing the correct dates. Am I missing something?

```
const options = {
fromUrl: reaction.upload.secure_url,
toFile: `${RNFS.DocumentDirectoryPath}/reaction_video.mov`
}
const ret = RNFS.downloadFile(options)
ret.promise.then(result => {
// touch file so the date is modified to today
const now = new Date()
return RNFS.touch(options.toFile, now, now)
})
.then(() => RNFS.stat(options.toFile))
.then(result => {
console.log('stat: ', result) // this shows that the file has the correct dates
CameraRoll.saveToCameraRoll(`file://${options.toFile}`, 'video')
})
.then(result => {
console.log('save successful! ', result)
})
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.