GNU bug report logs - #49428
RFE: for --time have option to only include contents, not dir itself.

Previous Next

Package: coreutils;

Reported by: L A Walsh <coreutils <at> tlinx.org>

Date: Tue, 6 Jul 2021 05:21:02 UTC

Severity: wishlist

To reply to this bug, email your comments to 49428 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#49428; Package coreutils. (Tue, 06 Jul 2021 05:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to L A Walsh <coreutils <at> tlinx.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 06 Jul 2021 05:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: L A Walsh <coreutils <at> tlinx.org>
To: Coreutils <bug-coreutils <at> gnu.org>
Subject: RFE: for --time have option to only include contents, not dir itself.
Date: Mon, 05 Jul 2021 22:18:30 -0700
I did a re-install-in-place on windows that reset the
dirtimes on all the dirs to the date I did the re-inst.

As a partial recovery, I want to be able to reset the date
to the time of the last modified file in the dir.

I thought to use:

  du -s --time DIR

but it's not just showing (from manpage):

      --time show time of the last modification of any file in the 
directory,
             or any of its subdirectories

instead it is showing the above & the time on the dir itself.
Some people may want to include the dir time, but that's usually
obvious by the time on the directory.

Nevertheless, perhaps a "--contents" flag to not include
the size of the directory-inode itself might be useful?

Sadly --separate-dirs doesn't really separate out all
the dir-sizes either, but only subdirs.

*sigh*
tnx!





Information forwarded to bug-coreutils <at> gnu.org:
bug#49428; Package coreutils. (Tue, 06 Jul 2021 06:58:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: L A Walsh <coreutils <at> tlinx.org>
To: 49428 <at> debbugs.gnu.org, Coreutils <bug-coreutils <at> gnu.org>
Subject: Re: bug#49428: RFE: for --time have option to only include contents, 
 not dir itself.
Date: Mon, 05 Jul 2021 23:56:37 -0700
First stab at a script is really slow...

find dirs, then find all files in the dir:

There's gotta be a faster way...ug!

lastt=1
shopt -s lastpipe

find "$1" -depth -type d |
 while read dr;do
   t=$(find "$dr" -xdev -maxdepth 1 -mindepth 1 ! -name . -a ! -name .. 
-printf "%T@\n" |
       cut -d. -f1|sort -rn|head -1)
   if [[ ! $t ]]; then
     t=$lastt
   fi
   if [[ ! $t ]]; then
     echo "dir=$dr"; exit 1; fi
   #echo "touch -d \"@$t\" \"$dr\""
   touch -d "@$t" "$dr"
   lastt=$t
 done






Information forwarded to bug-coreutils <at> gnu.org:
bug#49428; Package coreutils. (Tue, 06 Jul 2021 06:58:02 GMT) Full text and rfc822 format available.

Severity set to 'wishlist' from 'normal' Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Mon, 21 Feb 2022 09:55:02 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 115 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.