Bug 342663

Summary: Copying files to a device via MTP wipes modification date
Product: [Frameworks and Libraries] kio-extras Reporter: Kubuntiac <user581>
Component: MTPAssignee: Philipp Schmidt <kde-bugs>
Status: RESOLVED UPSTREAM    
Severity: normal CC: cfeck, elvis.angelaccio, faure, kdelibs-bugs, sitter, yotejes502
Priority: NOR    
Version: 18.04.3   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Image of the date change in Dolphin

Description Kubuntiac 2015-01-09 18:07:36 UTC
Hi there,

When I look at files on my Nexus 5 device in Dolphin, the creation date shows up fine. It remains correct when I copy files from the device to my pc. If I copy that file back though, the creation date is changed to the date and time it was copied, not the date it was created.


Reproducible: Always

Steps to Reproduce:
1. Find a file with a creation date in the past
2. Copy a file from a local filesystem to a device via MTP
3. Notice that the creation date is now the date it was copied, not created

Actual Results:  
Creation date is switched to the copy date

Expected Results:  
Creation date remains the same, just as it does when copying files off the device via MTP

I'm using a Nexus 5, with OmniRom Android 4.4.3, Kubuntu 14.10 with the Plasma 5 tech preview. I've tried with jpgs and mpg files, confirming the creation date via right click > properties in Dolphin and Digikam.

I've filed this as critical although it seems fairly minor, as it does cause users to lose the data about when their files were created ie. data loss. On something like legal documents or photos of users kids, these details could be very important.
Comment 1 Kubuntiac 2015-01-09 18:15:37 UTC
Created attachment 90306 [details]
Image of the date change in Dolphin

Example in Dolphin
Comment 2 Christoph Feck 2015-01-10 17:34:26 UTC
Oh wait, you are indeed using Plasma 5. Is Dolphin also the KF5 version? It has not been released yet.
Comment 3 Kubuntiac 2015-01-10 17:40:49 UTC
The about screen says Dolphin is version 4.14.1. I'm using the official Kubuntu ppa packages.
Comment 4 Christoph Feck 2015-01-10 17:52:20 UTC
Thanks for the update. Dolphin 4.14.1 does not use the KF5 kio framework, even when you run it within the Plasma 5 Workspace.
Comment 5 Kubuntiac 2015-01-10 18:13:54 UTC
Um, OK. So this would be a bug in the frameworks 4 presumably, rather than frameworks 5. It's still a bug though, and this is still the right place to file it, isn't it? Or did I accidentally file it just against frameworks 5?
Comment 6 Christoph Feck 2015-01-10 22:45:12 UTC
Yes, to both :)
Comment 7 Kubuntiac 2015-01-11 03:36:16 UTC
Oops.Sorry about that. It's been a while since I've used bugs.kde.org
Comment 8 David Faure 2015-02-01 18:25:24 UTC
There is no such thing as "creation date" in posix. The date you see is "modification date".

There's a bug / missing feature if it's not preserved during a copy (KIO provides the information, but every kioslave has to honour it). I just want to clarify that this is the metadata "modified" that kio-mtp should use to set the mtime on the destination file.
Comment 9 Harald Sitter 2022-01-06 12:09:45 UTC
*** Bug 424950 has been marked as a duplicate of this bug. ***
Comment 10 Harald Sitter 2022-01-06 12:25:32 UTC
https://github.com/libmtp/libmtp/issues/94

>             file->modificationdate = lastModified.toSecsSinceEpoch();   // no matter what to set here, current time is taken


seems to be an upstream bug