• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Time stamp of copied file always 'now'

My device is a Huawei Mate 9 with Oreo 8.0.

When I copy a file (locally, any file manager) or from an SSH client (my device runs SSH Droid and 'SSH server') to a folder of the internal storage (/storage/emulated/0) the copy date is always the time of the copy action (which I call 'now'), not the original file time stamp.

I know that a Linux shell cp action does the same, but when running cp -a <src> <target> it sets the timestamp of the original file. This works under Ubuntu 18.04 and macOS 14.1 and previois versions of Android (6.0 or less). When I do a copy action in a shell under Android 8.0, it issues an 'access denied' error when performing cp -a. It does copy, but sets the timestamp to 'now'.

A more clear example is this: on my previous phone running KitKat 4.4 I had FolderSync which syncs with a computer running an SSH server and worked flawlessly. However, on my Mate 9 this app is useless, because the timestamps are messed up because of this bug.

Do others have a similar problem ?
 
Microsoft used to own the browser space. Way back when there was a code that would make the date change to today if you used it. It was for Word documents but they intergrated it into their Internet Explorer code.
Are you using Internet Explorer on your device?
 
Try using cp -p instead and see what happens (-p for preserve, as in file attributes). Odd that the -a flag (archive) would result in an error message though.
 
This is about Android, not Windows.
Microsoft used to own the browser space. Way back when there was a code that would make the date change to today if you used it. It was for Word documents but they intergrated it into their Internet Explorer code.
Are you using Internet Explorer on your device?
 
Microsoft changed the Internet Explorer name to Microsoft Edge for Android devices 3 or 4 years ago @androidgeek2019. It sould work on your device. All I was truing to say is a small line of code can make a big difference. You may have to /root your device.

Re-reading your original post I see you probably already know that. Just trying to help.
 
Back
Top Bottom