How does KDE Connect preserve timestamps when files are copied off a phone?

Simon Redman simon at ergotech.com
Wed Dec 29 00:02:43 GMT 2021


Hi Sean,

Just to be sure we're talking about the same thing, there are two ways 
of copying files using KDE Connect.

You can share a file, usually by right-clicking it on the desktop 
implementation or by using Android's share dialogue.

Alternatively, you can mount the phone's filesystem using SSHFS and 
browse it on your computer and copy files using your file browser. (I 
think this is what you're talking about).

In the case of the share plugin, some parts of the file metadata (maybe 
only modified time) are copied over with the file and explicitly set on 
the resulting file. See !52 
<https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/52> in 
kdeconnect-kde.

For the SSHFS browser, the details would be up to the specific SSHFS 
implementation. It sounds like you've found some which behave differently.

Note that the file metadata is highly dependent on the filesystem. See 
this Stack Overflow post <https://unix.stackexchange.com/a/40052> for a 
brief discussion. It may be that your old and new phones use a different 
filesystem, which might be causing this metadata to behave strangely.

Thanks,
Simon

On 12/27/21 22:18, Sean Warner wrote:
> Hello,
>
> I just got the KDE Connect app on my Pixel Android Phone. I set up a 
> few folders on my phone to share and paired the phone with the KDE 
> Connect app in my Manjaro OS.
>
> Now I can view the contents of some folders in the phone in Dolphin 
> file explorer then drag and drop files in to my Manjaro home folder.
>
> My question:
> When I drag and drop files only the modified and accessed timestamps 
> are preserved. I figure there is no way to preserve the created 
> timestamp because on the target file system a new file is created when 
> I copy one over from the phone... yes?
> But here is where I'm confused.
>
> If I just connect the phone to the computer running Manjaro I enable 
> File Transfers in the phone USB Preferences I can also drag files off 
> the phone to the Manjaro home folder... however, in this case only the 
> modified timestamps are preserved.
>
> I also tested by installing SimpleSSHD on the phone and using rsync 
> and scp to copy files off... in the case of rsync only the modified 
> timestamp is preserved. In the case of SCP, the modified TS is 
> preserved and confusingly the accessed timestamp that is copied over 
> is not the same as what I see in the File Properties of the file ON 
> the phone but I have a feeling that the accessed TS that is "copied" 
> over is the datetime the file was copied over from my old HTC phone to 
> the new Pixel that I only started using a few weeks ago.
>
> KDE Connect preserves the modified and accessed timestamps but the 
> later is the "original" accessed timestamp that I see in the file 
> properties of the file ON the Pixel. Can someone explain why/how KDE 
> Connect preserves timestamps.. in particular the accessed TS but 
> also.. why does it not preserve the created TS?
>
> Thank you,
>
> Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20211228/d3703f90/attachment.htm>


More information about the KDEConnect mailing list