Re: restoring a tar archive && modification time of directories

From: Matthias Apitz <guru_at_unixarea.de>
Date: Thu, 01 May 2025 18:33:34 UTC
I can reproduce the problem with:

$ rm -r d
$ mkdir d
$ touch -t 202504300101 d/file d
$ ls -ld d d/file
drwxr-xr-x  2 guru wheel 512 30 abr.  01:01 d
-rw-r--r--  1 guru wheel   0 30 abr.  01:01 d/file
$ tar cf d.tar d

(without deleting the directory 'd')

$ tar xf d.tar
$ ls -ld d d/file
drwxr-xr-x  2 guru wheel 512  1 may.  20:25 d
-rw-r--r--  1 guru wheel   0 30 abr.  01:01 d/file

i.e. if the directories are existing (as it was in my original case
restoring into my HOME a backup), the modification time of the directory
will not be adjusted to the value in the tar archive. One could call
this a bug or a feature. Don't know.

	matthias
-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub

An die deutsche Bundesregierung: Nein, meine Söhne geb' ich nicht für Ihren Krieg!
Al Gobierno alemán: ¡No, no doy mis hijos para su guerra!
To the German Government: No, I will not give my sons for your war!