cvs commit: src/bin/cpdup cpdup.c cpdup.h hclink.c

Oliver Fromme check+j46qnt00rswghizp at fromme.com
Fri Aug 18 01:54:13 PDT 2006


Matthew Dillon wrote:
 > dillon      2006/08/17 18:13:51 PDT
 > 
 > DragonFly src repository
 > 
 >  Modified files:
 >    bin/cpdup            cpdup.c cpdup.h hclink.c 
 >  Log:
 >  Fix a memory leak and greatly reduce the memory allocated when remembering
 >  hardlinked files.

While you're working on cpdup ...  There's one thing which
I've always missed in cpdup:  The mtimes of directories are
not correctly duplicated.  Instead, the mtime of all
directories is set to the current time.  I guess that's
because cpdup updates the contents of directories and
doesn't care to fix the directory's mtime afterwards.

Is there a chance it could be fixed?  I don't think that
it's difficult, but I must confess that I haven't looked
at the code, actually.

Currently I use the following workaround:  After each time
cpdup is used, I run the following command (via a shell
script wrapper):

cd $SRC; find -d . -type d | cpio -dump $DEST

It fixes the mtimes of all directories.  Most of the time,
the meta data of the directory tree is still cached from
the cpdup run, so the performance isn't extremely bad.
It's still an ugly hack, though, and I would prefer it
to be fixed in cpdup itself.

(If you agree that it's easy to fix, I could even have a
look at the code myself.)

Best regards
   Oliver

-- 
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd

Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.





More information about the Commits mailing list