2.9 cpio -pm file modification time not retained for new directories

Michael Ryan michael.ryan@pobox.com
Fri Apr 24 11:30:00 GMT 2009


Hello,

When I run a command similar to this:

    find srcdir -depth | cpio -pdvm archive-dir

cpio v2.9 does not retain the modification timestamp of non-empty 
directories under srcdir that do not already exist in archive-dir, i.e. 
when cpio creates a new non-empty directory under archive-dir its mtime 
is set to the time of its creation, not the mtime of the directory it 
copied from srcdir.  If the directory under srcdir is empty (has no 
files in it) the mtime is retained correctly.

Here's an example (each command is separated by a line of dashes for 
readability).  This example shows that both 'x' and 'testdir' 
directories have not had their mtimes retained by cpio...

-------------------------------------------------------------------------------
$ cpio --version
cpio (GNU cpio) 2.9
-------------------------------------------------------------------------------
$ ls -ld x
drwx------+ 3 mr104201 ryan 0 Apr 23 20:57 x
-------------------------------------------------------------------------------
$ ls -lR x
x:
total 0
drwx------+ 2 mr104201 ryan 0 Mar 10 19:05 testdir

x/testdir:
total 1
-rw------- 1 mr104201 ryan 31 Apr  2 12:13 somefile.txt
---------------------------------------------------------
$ mkdir y
---------------------------------------------------------
$ find x -depth | cpio -pdvm y
y/x/testdir/somefile.txt
y/x/testdir
y/x
1 block
---------------------------------------------------------
$ ls -lR y
y:
total 0
drwx------+ 3 mr104201 ryan 0 Apr 23 21:03 x

y/x:
total 0
drwx------+ 2 mr104201 ryan 0 Apr 23 21:03 testdir

y/x/testdir:
total 1
-rw------- 1 mr104201 ryan 31 Apr  2 12:13 somefile.txt
---------------------------------------------------------


Regards,
Mike

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygcheck.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20090424/3357e7d3/attachment.ksh>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list