GNU bug report logs - #12675
find RFE test verb "-inodes"

Previous Next

Package: coreutils;

Reported by: Linda Walsh <coreutils <at> tlinx.org>

Date: Thu, 18 Oct 2012 16:43:01 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12675 in the body.
You can then email your comments to 12675 AT debbugs.gnu.org in the normal way.

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#12675; Package coreutils. (Thu, 18 Oct 2012 16:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Linda Walsh <coreutils <at> tlinx.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Thu, 18 Oct 2012 16:43:02 GMT) Full text and rfc822 format available.

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

From: Linda Walsh <coreutils <at> tlinx.org>
To: bug-coreutils <at> gnu.org
Subject: find RFE test verb "-inodes"
Date: Thu, 18 Oct 2012 09:41:17 -0700


A useful thing to be a test on the number of non-structural entries in a 
directory.

By non structural, it would work like ls -A, and not include entries 
that are
part of the directory structure like "." and ".." -- with the idea of being
able to quickly determine if a directory is empty.

Maybe 'inodes' with standard +/- adjectives

So "find . -type d -inodes 0" would find all the empty dirs.

Unless, of course this is already in there and I've missed it... but
didn't see anything that would provide this w/o calling an external func
on each dir...which really slows things down...







Information forwarded to bug-coreutils <at> gnu.org:
bug#12675; Package coreutils. (Thu, 18 Oct 2012 17:19:02 GMT) Full text and rfc822 format available.

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

From: Bob Proulx <bob <at> proulx.com>
To: Linda Walsh <coreutils <at> tlinx.org>
Cc: 12675 <at> debbugs.gnu.org
Subject: Re: bug#12675: find RFE test verb "-inodes"
Date: Thu, 18 Oct 2012 11:17:21 -0600
Linda Walsh wrote:
> A useful thing to be a test on the number of non-structural entries
> in a directory.
> 
> By non structural, it would work like ls -A, and not include entries
> that are part of the directory structure like "." and ".." -- with
> the idea of being able to quickly determine if a directory is empty.
> 
> Maybe 'inodes' with standard +/- adjectives
> 
> So "find . -type d -inodes 0" would find all the empty dirs.
> 
> Unless, of course this is already in there and I've missed it... but
> didn't see anything that would provide this w/o calling an external func
> on each dir...which really slows things down...

Do you mean something like find -empty?

 -- Test: -empty
     True if the file is empty and is either a regular file or a
     directory.  This might help determine good candidates for
     deletion.  This test is useful with `-depth' (*note Directories::)
     and `-delete' (*note Single File::).

Example:

  $ find . -empty

Bob




Added tag(s) notabug. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Thu, 18 Oct 2012 17:25:01 GMT) Full text and rfc822 format available.

Reply sent to Eric Blake <eblake <at> redhat.com>:
You have taken responsibility. (Thu, 18 Oct 2012 17:25:02 GMT) Full text and rfc822 format available.

Notification sent to Linda Walsh <coreutils <at> tlinx.org>:
bug acknowledged by developer. (Thu, 18 Oct 2012 17:25:02 GMT) Full text and rfc822 format available.

Message #15 received at 12675-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Linda Walsh <coreutils <at> tlinx.org>
Cc: 12675-done <at> debbugs.gnu.org
Subject: Re: bug#12675: find RFE test verb "-inodes"
Date: Thu, 18 Oct 2012 11:23:03 -0600
[Message part 1 (text/plain, inline)]
tag 12675 notabug
thanks

On 10/18/2012 10:41 AM, Linda Walsh wrote:
> A useful thing to be a test on the number of non-structural entries in a
> directory.
> 
> By non structural, it would work like ls -A, and not include entries
> that are
> part of the directory structure like "." and ".." -- with the idea of being
> able to quickly determine if a directory is empty.

So which do you really want - to know how many directory entries exist,
or to just know if a directory is (non-)empty?  The former would be a
new feature, while the latter already exists as a GNU find extension.

> 
> Maybe 'inodes' with standard +/- adjectives
> 
> So "find . -type d -inodes 0" would find all the empty dirs.
> 
> Unless, of course this is already in there and I've missed it... but
> didn't see anything that would provide this w/o calling an external func
> on each dir...which really slows things down...

Sorry, but you've reached the wrong list.  GNU coreutils does not
maintain find(1); for that, you'd need to write to the findutils list.
But while you are correct that POSIX does not provide this capability,
GNU find already does what you want:

find -type d -empty

-- 
Eric Blake   eblake <at> redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#12675; Package coreutils. (Thu, 18 Oct 2012 17:57:02 GMT) Full text and rfc822 format available.

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

From: Linda Walsh <coreutils <at> tlinx.org>
To: 12675 <at> debbugs.gnu.org
Subject: Re: bug#12675: closed (Re: bug#12675: find RFE test verb "-inodes")
Date: Thu, 18 Oct 2012 10:55:22 -0700
[Message part 1 (text/plain, inline)]
>
> Subject:
> Re: bug#12675: find RFE test verb "-inodes"
> From:
> Eric Blake <eblake <at> redhat.com>
> Date:
> Thu, 18 Oct 2012 11:23:03 -0600
> To:
> Linda Walsh <coreutils <at> tlinx.org>
>
> To:
> Linda Walsh <coreutils <at> tlinx.org>
> CC:
> 12675-done <at> debbugs.gnu.org
>
>
> tag 12675 notabug
> thanks
>
>   
>> on each dir...which really slows things down...
>>     
> Sorry, but you've reached the wrong list.  GNU coreutils does not
> maintain find(1); for that, you'd need to write to the findutils list.
> But while you are correct that POSIX does not provide this capability,
> GNU find already does what you want:
>
> find -type d -empty
>
>   
Re: list: oops!   Forgot!
Re: -empty: That'll work for my current need,

Thanks!
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 16 Nov 2012 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 276 days ago.

Previous Next


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