bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tar doesn't restore all directory timestamps from the extracted archive


From: Vincent Lefevre
Subject: tar doesn't restore all directory timestamps from the extracted archive
Date: Thu, 22 Jul 2021 15:08:20 +0200
User-agent: Mutt/2.1.1+39 (abd78fb4) vl-138565 (2021-07-22)

With some archives, like /usr/src/linux-source-5.10.tar.xz in Debian,
tar doesn't restore all the directory timestamps from the extracted
archive. This is not an incremental archive, but the list of files
were provided in input at the .tar creation in an order not compatible
with the algorithm described at

  
https://www.gnu.org/software/tar/manual/html_node/Directory-Modification-Times-and-Permissions.html

The tar option --delay-directory-restore fixes the issue. But this
behavior should be the default.

I don't see the point of the current default behavior, where the rule
for timestamp restoration is a bit complex and non-intuitive.

Directory-Modification-Times-and-Permissions.html suggests that it
could be memory requirements: "This approach allows to correctly
restore directory meta-information in the majority of cases, while
keeping memory requirements sufficiently small." But I don't see why
the --delay-directory-restore behavior would require much memory.
For instance, in the /usr/src/linux-source-5.10.tar.xz example,
which is an archive with many directories, storing all the directory
information (without optimizations based on the tree sturcture),
i.e. directory pathnames and timestamp, would take less than 300 KB:

$ find linux-source-5.10 -type d | wc
   4712    4712  214370

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]