Bug 382293 - Irritating backup file modification time on Windows
Summary: Irritating backup file modification time on Windows
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: file (show other bugs)
Version: 4.8.0
Platform: Other Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks: 381786
  Show dependency treegraph
 
Reported: 2017-07-13 07:45 UTC by Ralf Habacker
Modified: 2019-08-31 11:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.1,5.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2017-07-13 07:45:42 UTC
At bug 302945 creating a backup file on Windows has been fixed. Testing this function with the 4.8.1 snapshots on Windows (see bug 380075 for getting snapshots) shows a difference compared to the linux implementation.

The difference is that on Windows the modify time stamp shows the modification time of the original kmymoney file. This modification time is displayed in the explorer and let people think that this backup is not up to date which may be irritating.

How to reproduce:
1. start kmymoney
2. open kmymoney file if not open
3. select file->backup and make a backup

What happens ?
The newly created file shows the mentioned behavior

What is expected ?
The modification time of the newly created file should have the same value as the creating time.
Comment 1 Thomas Baumgart 2017-07-13 15:32:57 UTC
This looks like a Windows feature, so Windows users should not be irritated. It's the Linux user on Windows who is irritated (and vice versa).


C:\Users\thomas.baumgart>copy Thumbs.db bla.bla
        1 Datei(en) kopiert.

C:\Users\thomas.baumgart>dir Thumbs.db bla.bla
 Volume in Laufwerk C: hat keine Bezeichnung.
 Volumeseriennummer: 8C43-1CC6

 Verzeichnis von C:\Users\thomas.baumgart

23.04.2013  19:23             6.656 Thumbs.db

 Verzeichnis von C:\Users\thomas.baumgart

23.04.2013  19:23             6.656 bla.bla
               2 Datei(en),         13.312 Bytes
Comment 2 Jack 2017-07-13 15:53:30 UTC
'copy /b backup+ ,,' after doing the backup will update the file time.  The commas indicate absence of destination, so the file isn't actually copied, but timestamp is modified in place.  (found from a post on superuser.com, pointing to docs on technet.microsoft.com, which has more than "help copy" shows.
Comment 3 Jack 2017-07-13 15:55:27 UTC
Note I do not know if this behavior is different on different versions of Windows.  My example works on Windows 7.
Comment 4 Thomas Baumgart 2017-07-13 17:11:44 UTC
https://superuser.com/questions/10426/windows-equivalent-of-the-linux-command-touch seems to be that link. I have to admit: absolutely intuitive.
I can confirm though that it works with Win10 also in case that is of help to anyone.
Comment 5 Ralf Habacker 2017-07-17 11:43:24 UTC
Git commit 5cf2e46c185098bbd141cf4f80693df19edb48af by Ralf Habacker.
Committed on 13/07/2017 at 09:38.
Pushed by habacker into branch '4.8'.

Fix 'Irritating backup file modification time on Windows'

MS way to touch modification date of a copied file is to append '+nul'
to the source filename.

FIXED-IN:4.8.1

M  +2    -2    kmymoney/kmymoney.cpp

https://commits.kde.org/kmymoney/5cf2e46c185098bbd141cf4f80693df19edb48af