Page 1 of 1
Copy File/Files action and lastModified time
Posted: 29 Mar 2019 23:37
by anuraag
Hi Martin
Currently Copy File/Files action don't preserve source file's lastModified time. Instead it sets current time. Please fix it.
Re: Copy File/Files action and lastModified time
Posted: 30 Mar 2019 01:43
by Desmanto
As I know, this is android limitation. To preserve the time stamp, you have to use root. Some file manager (MiXplorer) use "touch" to keep the time stamp. You can use MiXplorer copy action to keep it.
All Automagic copy/move/init file and similar I/O action seems to be executed using normal user privellege, so can't use any root related action. Have to use root command version instead, example : cp, mv, ls, cat.
Re: Copy File/Files action and lastModified time
Posted: 30 Mar 2019 02:07
by anuraag
What do you mean by *touch* to keep?
Edit: Do you mean "Last modified time" setting of MiXplorer?
Some file managers preserving last modified time. I think they are using
setLastModified method to preserve lastModified time. I have tested it in automagic and it works.
I have tried cp without root. It preserves lastModified time for internal storage. For external storage it don't work.
Re: Copy File/Files action and lastModified time
Posted: 01 Apr 2019 10:07
by Desmanto
touch in terminal emulator command. It can be used to modify the timestamp after copy. So there is java equivalent to do it. Since it can be done without root, then there should be checkbox to preserve the timestamp for copy/move file actions.
For external storage, it seems the command should be passed thru the document provider. Same as the OTG flashdisk/harddisk or any external storage.
Re: Copy File/Files action and lastModified time
Posted: 01 Apr 2019 12:39
by Martin
Hi,
The next update should preserve the last modified time when possible (on internal storage when Android allows to).
Not yet sure if this will work on external storage but I'll investigate.
Regards,
Martin
Re: Copy File/Files action and lastModified time
Posted: 01 Apr 2019 12:42
by anuraag
@Martin i have tested that java method setLastModified on external storage. It works.
Re: Copy File/Files action and lastModified time
Posted: 01 Apr 2019 13:01
by Martin
Maybe we mean the same thing. External storage is sometimes named internal storage. I mean I have to investigate if it's possible when file access has to be done with the storage access framework and not via classic File class.