From 4446e0d794429c7ad7d8a82996f6b346949e45c6 Mon Sep 17 00:00:00 2001 From: Archie Cobbs Date: Thu, 25 Nov 2010 14:57:25 +0100 Subject: [PATCH] Improve documentation regarding -m/--preserve-modification-time The behavior of "-m" with respect to directories is dependent on the way in which the cpio archive has been created, because when unpacking an archive, cpio simply reads the files/directories in the order they exist in the archive and unpacks them in that order, so the modification time of non-empty directories is in general case not correct after the archive is extracted. Therefore, to make cpio "-m" to work correctly with non-empty directories, the archive must be created with directories following their content, e.g. by adding the "-depth" flag to the find command used to create it. This patch mentions this fact in texinfo documentation. --- doc/cpio.texi | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/doc/cpio.texi b/doc/cpio.texi index bcece3c..48e4aa7 100644 --- a/doc/cpio.texi +++ b/doc/cpio.texi @@ -465,7 +465,11 @@ link itself. @item -m @itemx --preserve-modification-time -Retain previous file modification times when creating files. +Retain previous file modification times when creating files and directories. +Note: for directories, modification times get updated when a contained file is +created. Therefore, for this flag to work as expected, the archive must be created +with directories following their contents, e.g., using the @option{-depth} flag to +the @command{find} command. @item -M @var{message} @itemx address@hidden -- 1.7.1