yashsingh1/xdaforums huggingface dataset:
[Android General] Old faithful:
Root is the only way to keep the file timestamp as this issue is inherent with stock android and your app needs root access to correct that system bug. Root also gives you full ownership of your device and the opportunity to gain total control to do many things Google would rather you not do, for whatever reason they may advance, suffice it to say they didn't become rich for no reason.

But be aware that with great power comes great responsibility and greater risk of causing problems that may be irreversible (turning your device into a "brick") and warranty service denial...

It all comes down to this: do you prefer freedom or security? My advice is to heed Benjamin Franklin's famous quote: "Those Who Sacrifice Liberty For Security Deserve Neither"
[Android General] jvwr:
That's a great quote! But the point is I'm not looking for Security, but simplicity. I just want the simplicity of copying my files and they keep they atributes, just that.

A root device may take me more time to spend on my phone, and I don't want that. I just want Google to take care of it, but Google is not collaborating.

In fact, You are right. Google is taking care of my security, but I have no freedom.

And I was thinking that only Apple was like that...

I'm very dissapointed in Google.
[Android General] tag68:
Then just root it (without flash recovery). Use Total Commander for copying. And you're done.

Only special case is update of OS: you need to unroot before update (just select "unroot" in SuperSU, the root managing app), and root (install SuperSU by flashing) again afterwards. All other things don't change.
[Android General] Old faithful:
Agreed! And with some devices you can root simply from the app. But without a custom recovery it's difficult to make full backups, which are such a time saver!
[Android General] tag68:
Disagree: That you do not flash the custom revocery does not mean you can not use it. You need to connect the computer and type "fastboot boot twrp.img" every time you want to do or restore a backup or root (whatever you need the custom recovery for) - but as you don't do that every day, I vote for the ease of OTA update in this point.
[Android General] userwaldo:
Using ADB to perserve timestamp and attributes when copying

I found the best way to copy files from my PC to an Andriod device and keep both time stamps and attributes correct, is to use TWRP Boot loader and ADB. (Might work with other bootloaders, but I only tested TWRP (v3.0.0) on Nexus 7.)

If you have a bunch of file and folders you should be one directory up on the push.

i.e. Files are in /top/backup on the PC.

cd into /top

Then:

adb devices

adb reboot recovery

adb push backup/ /sdcard

adb shell

chgrp -R media_rw <FILES>

chown -R media_rw <FILES>
[Android General] sjlouis:
Hum! I haven't receive any notification for the new posts :( .

There is a very simple way to keep your files timestamps. You connect via USB your 2 phones on a Windows PC and you copy the files with Windows Explorer ;) .

I was happy too fast. Total commander keeps timestamps with "move" but not with "copy". Have you the same problem?
[Android General] tag68:
No. Just copied from external SD to internal Download dir and the timestamp is copied fine.
[Android General] sjlouis:
It's a little astonishing, yesterday the copy command didn't keep timestamps (I've done several tests) and it works today. And yesterday Busybox worked again while I had an error message previously, and I'm sure I hadn't any update.

Ok, the main thing is it works :cool: .

For Total Commander, do you know what does the circular green arrow on the top right. I thought it was "Undo" but not.
[Android General] Old faithful:
You need to be in root mode... One of my pet peeves with Ghost Commander (should be settable as permanent, it's apparently by design)
[Android General] tag68:
Long tap shows that it means "refresh"
[Android General] sjlouis:
For the green circular arrow, I gone in a repertory where I have a file, I swapped in another application to move this file and when I come back to Total Commander, I press quickly on the arrow to refresh the screen and the file disappear. Is it what you want to say tag68? It was not a long tap, a quick tap does it.

Old faithful, I haven't change any parameter. Then I don't know why it's good now :eek: .
[Android General] tag68:
Of course a short tap executes. For me a long tap showed the description what it does ;)

Old faithful refers to Ghost Commander. Total Commander just works fine without setting anything except grant access in SuperSU.
[Android General] sjlouis:
Ok, thank you.

Do you know if the developer listens users? If we can ask for improvements? If he responds when we ask to solve a problem?
[Android General] tag68:
There exists a forum for Total Commander Android where the developer regularly responds (abut once a day). You can post there english or german, both is fine. That Total Commander deals fine with timestamps when having root rights is because he read my emails ;).
[Android General] sjlouis:
Good news, thank you :) .
[Android General] Old faithful:
As for Ghost Commander, it is also well supported, the developer has always quickly responded to my emails when I discovered bugs and usually comes back with a new beta build within days.
[Android General] sjlouis:
It's a good thing. I like very much "File Manager" from Cheetah Mobile and I use "SManager" for scripts but the developers never respond :( .
[Android General] tag68:
There is a possible reason: if Total Commander does not get superuser rights, it is the expected behavior. Copy works fine, but it is not allowed to set timestamp. It can't. If it can, it does.
[Android General] sjlouis:
With "move" timestamps were kept but not for "copy". It was strange but now it works :) .

I've just installed AICP 6 based on Marshmallow and there is a strange behaviour with the SD card (external). I have 2 entries :

- USB but it's the SD card

- sdcard1 (6162-3265) and other programs only see "6162-3265" :eek: .

Even if I have rights to see and write on the SD card, some programs can't.
[Android General] tag68:
It seems Total Commander does not set the time stamp anymore! At least not reliable. May be it only sets it if you do something using root before. Currently I'm having a look at X-Plore which according to the developer should set the timestamp correctly, when root mode is enabled. First test was good.
[Android General] sjlouis:
I've done tests with Copy and Move and I've kept timestamps ;) .
[Android General] tag68:
The answer in the forum of TC was, that TC does not ask for root access for external SD on Android 5 and higher, because it is not necessary and the developer thinks, it is not a good idea to ask for root access for move/copy if it is only because of the timestamp.

For internal SD it may still work as expected. And maybe it works for external also, if you already did some operation that required root. But for me the summary is: It is not reliable that TC sets the timestamps.
[Android General] tag68:
In the meantime the author answered TC should set timestamp fine - and now I found out that accessing the external SD via /storage/xxxx-xxxx sets timestamp fine, but accidentally I used ///_Name. Think I deleted this one before because something was wrong, but it appeared again.
[Android General] wilflare:
which app are you using? TC still?
[Android General] sjlouis:
Yes I've done tests with TC between internal memory and external SD.
[Android General] Old faithful:
You guys should really give Ghost Commander a try - the developer is improving it constantly. It does it all so well, even its text editor is excellent, I've uninstalled all the other file managers I was using (I still use Total Commander on my PC though), that's how good and reliable it's become. To really unleash its ull powers, though, you need BusyBox installed.

Moves with Ghost Commander between Internal and SD Card don't require root to keep timestamps, only Copy does and its just a matter of clicking the root button on either origin or destination folder...
[Android General] tag68:
The mobile of my wife is rooted, but BusyBox will there not be installed. It is seldom that there a file manager gets used, but I'd like to use the same one on all devices. I remember that Ghost Commander needs BusyBox (without stating this requirement, and I don't know for which purpose). That is fine for me on my device, for many apps like development things. But not for a general tool which I recommend to others, who are less power users than me. I mention it in the FAQ, and I'd like to have more file managers in the list. May be some day I have a second look at Ghost Commander, but my time is limited. There are alternatives without the restriction BusyBox required.
[Android General] Old faithful:
I don't disagree with your assessment and understand your concerns for 'civilians'; Fact is, root has to be activated on Ghost commander before it will execute any powerful commands and there are also other safeguards for the system partition, such as mounting/unmounting it and taking ownership. You really need to go through a lot of safeguards before you can cause real harm! Besides, BusyBox gives you direct access to security features such as getting the SHA file signatures, something I consider essential.

Then again, I like to own my own stuff and be able to decide what to do with it, and I strongly believe so should everyone else who has any sense of personal control over his or her own life.

Or am I completely besides the point in this discussion and what you really mean is that 'Root is a Bad Thing' and that regular users should be protected from themselves? In which case there is no point arguing, except perhaps for the fact this IS a power user forum that people go to to get empowered, not to be 'protected' from their own actions.
[Android General] wilflare:
any updates for users using Nougat?

wonder if Solid Explorer makes any difference
[Android General] tag68:
I'm not aware that there was any change. Although I have no Nougat device and my knowledge is only from what someone wrote in a forum, but the situation should be the same like for Marshmallow.

Until now I did not hear that Solid Explorer cares about the timestamp. You may compare with other explorers, or test using su/cp -a if it should behave correctly, and switch if Solid Explorer behaves worse that Total Commander, X-Plore and Ghost Commander.

If you find out that Solid Explorer is setting timestamp fine, please report it in this thread. Thank you in advance ;)
[Android General] wilflare:
I'll give it a try but just to clarify - how are we using Total Commander?

install TC, open TC on device, transfer files from device to PC? - is that what we are looking at?
[Android General] tag68:
No. Writing files on PC should be always fine. If not, it is not the fault of Android. The question is: Does Android allow to write timestamps?

The test is if the timestamp is kept when copying some file to internal or external SD. The test may behave different for a different file system.

You copy some file (source doesn't matter, just remember the timestamp, for instance a picture from the Camera) to eg. Download directory on internal and/or external SD. If timestamp is the same as source, it's a success. If it is set to current date/time, it's a fail.
[Android General] sjlouis:
I'm used to use File Manager. It's friendly and powerful. It keeps timestamps now. I also use SManager but it's for using scripts, it also keeps timestamps now but TC was the first one to keep them.
[Android General] tag68:
Which one is File manager? ASUS File Manager?

And SManager is Script Manager? This one really looks interesting!
[Android General] sjlouis:
For File Manager, sorry, I give you the French link to Playstore :

https://play.google.com/store/apps/details?id=com.rhmsoft.fm

Yes, SManager is Script Manager. It's powerful but a little ugly.
[Android General] wilflare:
hmmm I must have gotten it confused all along then :/

when transferring photos from my 6P to PC (and transferring them back), my photos all have their timestamps changed to the time of transfer :/
[Android General] sjlouis:
If you can use Windows Explorer, it keeps timestamps.
[Android General] tag68:
Transferring back is writing them on Android. This only works fine including timestamps if you are using some app or server using the power of the root user.

You may check additionally if copying to Windows did work fine including timestamp. In most cases it does (except for directories).
[Android General] wilflare:
I went to check my old transfers

- from Nexus 6P to PC: the Date Created is the date of copy, Date modified and Date Taken are both correct

(is that the right behaviour)?

the problem is when I copy the file back and the Date modified, Date Taken and Date Created changes to the date of transfer right?
[Android General] tag68:
Yes, that's what I think. Of course it depends on the copy method. If you share some directory on your pc containing the data via SMB and copy it using LAN plugin of Total Commander to your rooted Android device, keeping timestamp should work fine.
[Android General] sjlouis:
I've done a test and I was surprised. If I use "Copy" from phone to PC with Windows Explorer, timestamps are kept but it doesn't keep them in the other direction.
[Android General] tag68:
Does Samba Filesharing not allow setting timestamps anymore? That would be a pity, although I've not used it for quite some time.

sjlouis, are you sure you accessed your phone using Samba Filesharing?
[Android General] sjlouis:
I only use a cable to connect my phone to my PC, and Windows Explorer. I don't know how to select Samba filesharing.
[Android General] tag68:
Please have a look at the OP: "if you copy or move a file", "if the destination on Android". Why do you expect Windows Explorer to keep timestamp when copying files to Android if the destination does not allow to set it? Most probably it tries to do. But like other filemanagers, it does not complain if it is not allowed to.

You can find a link to Samba Filesharing in the OP. You can try to use it. The other direction (File manager on rooted Android accesses Share on the computer, or somewhere in the network) is by far easier to setup/configure. That's why I recommended it.
[Android General] sjlouis:
What does mean OP? The operating system?

Sorry, I'm not easy in English. In can find " Samba Filesharing" in Windows? In the settings of the phone?

I use the most convenient tool to copy/move files. In the phone, I use File Manager. From the phone to the PC, I use Windows Explorer and in this way, it keeps timestamps. It kept time stamps also in the other way with old Androïd version, 2.3 perhaps.
[Android General] tag68:
OP is the Opening Post of this thread. See, I wrote a guide. There is explained - or should be - if Android in which versions allows writing of timestamps. And how to work around if it is restricted. There is mentioned that these restrictions started with Android 4.x with only some file systems, and that it now concerns all file system. It is the topic of this thread [GUIDE][HOW-TO] ... you should get used as user of xda developers forum to have a look at the first post of any thread before writing a post.

Usually when exchanging files between two devices, there is one server and one client. For instance Samba/SMB is a protocol which started with Windows and is widely used on any OS. You start filesharing of a folder in Windows (or "Windows Filesharing" on a Macintosh), and you can start a client (like Total Commander with LAN plugin) on Android to access the files. You start a server like "Samba Filesharing" - the Android App is linked in the OP - on Android, and should be able to access from another computer.
[Android General] sjlouis:
Tag, I've red the opening post a few months ago and perhaps a few years ago. I don't remember it and as I've said, I'm not easy in English, that's why I don't post a lot on xda-developper. I just do it if I search to solve a (big) problem ;) .

Now I have Windows 7 and it's a little boring to access a Windows directory even if you have shared this directory because you can't access it from a Linux box (satellite receiver) unless you unprotect all the disk or something equivalent, I don't remember exactly.

I shall read again the first post ;) .
[Android General] sjlouis:
I've done another test with File Manager and it doesn't keep timestamps. I don't understand why it works well sometimes and not other times :( .
[Android General] PokeAlert:
Thanks for the guide!
[Android General] tag68:
sjlouis, thank you for the information. Tested it myself and SManager sets timestamp on my internal SD fine, Cheetah File Explorer does not. Guide is updated.
[Android General] sjlouis:
Yes but when I tested it a few days ago, it worked fine. It seems the latest version got the problem.
[Android General] tag68:
Are you sure that you chose the difficult destination when testing the first time? Seems a few days ago you were not aware that the destination is causing the problem. Did you notice usage of root access?
[Android General] sjlouis:
Yes I'm sure because I use a lot File Manager and I want to keep timestamps on my files. It was a long time I was angry to lost them because it's very convenient when you search a file. Total Commander was the first one to keep them, after there was Script Manager and after File Manager. I have to seek how to keep them in script. It worked fine when I did it manually but not in scripts. In fact, you have to execute script with "saving" the option SU.

So I tested File Manager again last week and it worked fine. As I said, I use FM with the phone (internal card, SD card) and Windows from phone to computer. I copy very rarely files from PC to phone, that's why I was surprised to lost timestamps. And when I have to copy a lot of files (photographies, music) for a new phone for example, I insert the SDcard in the computer. It's quicker.

Another problem with Androïd versions is to write to SDcard from an application. I use it for example for the backups and it's not always possible or only in specific repertory.
[Android General] GnatGoSplat:
Thanks OP, I have been searching Google for ways to copy photos to my phone while preserving timestamps and this thread is the only one that provided a usable solution.

My experience with Samsung Galaxy S4 running stock Lollipop:

Asus File Manager - Copy via SMB from Windows. Does not preserve timestamps.

ES File Explorer - Copy via SMB from Windows. Does not preserve timestamps.

Droid Explorer x64 (PC based, copy via USB/ADB) - Did not preserve timestamps, however, this was recommended in other threads.

Total Commander - Copy via SMB from Windows. It works perfectly, files copied to External SD preserves timestamps.

Ghost Commander - Copy via SMB from Windows. Enabled auto root and saw toast notifications it was granted root, but didn't copy to External SD at all. Acted like it was, but nothing was copied. Could not even delete from external SD, got a permission error. Lollipop has an annoying extra step of having to grant write access to External SD. Every other file manager was able to ask for it, Ghost Commander never did.

X-Plore File Manager - Copy via SMB from Windows. SMB timeout on several files with only option to SKIP. Files copied to External SD did preserve timestamps, but being forced to skip files due to SMB timeout error makes it unusable (no RETRY button).

For me, looks like Total Commander is the only workable solution so I've uninstalled everything else.
[Android General] sjlouis:
If I have solved some of the write problems on SD Card with Lolipop, I've installed AICP with Marshmallow and the problem is back while the solution is not the same :( .

As Cheetah File Manager becomes a little annoying to use, I use more more Total Commanders which works fine. I have to search if there is a specific post :) .
[Android General] sjlouis:
As I said, I've installed AIPCP 11 with Mashmallow (from AICP 10 and Lollipop) and Total Commander doesn't keep any more timestamps :( .
[Android General] tag68:
If TC does not keep timestamp when copying, there are two questions:

1. Does TC successfully request root?

2. What is the destination, and in which way is it accessed?
[Android General] sjlouis:
How can I verify Total Commander is full root? It can copy to external sdcard while Cheetah Explorer can't if it is not root but if I deactivate root for TC, it can also copy to external sdcard.

I did test from internal memory to internal memory and I did tests between internal memory and external sdcard in the 2 ways.
[Android General] tag68:
Idea for test: If I grant TC access for root, it can view the contents of /sbin. If access is denied, the contents is empty.

Disclaimer: I don't know if structure and permissions for AICP are same. My idea is to find some directory which can only be viewed using root. You'll recognize if the contents is different (empty) when you deny the rights. If /sbin is not handled the same, you may try another.

Don't you get a notification when some app gets the superuser rights granted?
[Android General] sjlouis:
When I go to main directory "/", I see a lot directories but not "/sbin". When I use Cheetah Explorer with no root, I can't go ahead "storage" but when I activate root, I can go to "/" and I see "/sbin".

When I activate root with Cheetah or other applications, system asks for authorization. When I activate root in TC, I haven't any message. Perhaps I can uninstall and reinstall TC. Something went wrong with the AICP flash.

What is your opinion?

---------- Post added at 01:59 PM ---------- Previous post was at 01:50 PM ----------

I've uninstalled and re installed TC. It doesn't keep timestamps and I don't see "/sbin" but now there is # during a few seconds in the notification bar (at the top of the screen).
[Android General] tag68:
If you don't see /sbin, my first guess is that root is not properly working for TC. I remember that some ROM (MIUI or CyanogenMod or similar) also had difficulties with TC not recognizing root. May be in the forum on ghisler.ch there can be found a similar problem in older threads.
[Android General] tag68:
Did a search and didn't find anything useful. Now I asked the question here

sjlouis, please test if command line is working:

su

cd (somewhere, eg download may be /storage/emulated/0/Download)

ls -l

(Pick some file)

cp -a file file.1

ls -l

And have a look if timestamp stays the same. Please tell the result here what happens.
[Android General] sjlouis:
Yes, AICP is based on CyanogenMod.

I've done what you asked. First time I used SManager (Script Manager) with root but the timestamps were not kept, the second time I used Terminal Emulator with root but the timestamps were not also kept.

Monday I tried to change rights on file with TC and there were not kept. What is astonishing, that there is no error message to commands cp -a and no more for modifying rights. In this case TC displays it is good.

If it's a known problem with Cyanogen, I'm afraid there will not be any correction. I ask for a bug for which end of movie file was not detected, which disturbs greatly applications as MX Player Pro and BSB Player but it was never corrected in CyanogenMod 12. It works well now with CyanogenMod 13.

Thank you very much for your help :) .

EDIT : is ghisler the creator of TC? Can I add a message to your one?
[Android General] tag68:
I'm not sure that I understood you correctly. You said test cp -a in terminal did NOT keep timestamps after using su?!? Never seen this. Does cp without parameters list -a as option? Do you use a cp from BusyBox or from Cyanogenmod?

It is unfortunately normal that not being able to set the timestamp when copying or moving does not throw an error. No matter if it is an explorer, some command line tool or else.

Yes, you may create an account in the Total-Commander-forum and add a comment yourself. That's the reason that I wrote english there, not german, although it is mixed language, both are accepted and Christian Ghisler and me have both mother tongue german. But if cp -a does not help when being root, I have no idea what could help. It's not in the possibilities of some app like Total Commander then to set that timestamp.