[Toybox] [PATCH] find: add -inum option.

Rob Landley rob at landley.net
Thu Jul 9 23:58:18 PDT 2015


Did Greg Hackmann write this, or did he just review it? (I.E. is git
--author Elliott or Greg here?)

Rob

On 07/06/2015 10:33 PM, enh wrote:
> ping?
> 
> On Fri, May 15, 2015 at 4:48 PM, enh <enh at google.com
> <mailto:enh at google.com>> wrote:
> 
>     find: add -inum option
> 
>     -inum is a commonly implemented extension to search by inode number.
> 
>     Linux's fs-layer tracepoints log many events in terms of inodes, so
>     "find -inum" is useful for mapping those events back to specific files.
> 
>     Signed-off-by: Greg Hackmann <ghackmann at google.com
>     <mailto:ghackmann at google.com>>
> 
>     diff --git a/toys/posix/find.c b/toys/posix/find.c
>     index 69e370d..1e9bdfe 100644
>     --- a/toys/posix/find.c
>     +++ b/toys/posix/find.c
>     @@ -32,6 +32,7 @@
>          -ctime N       created N days ago        -mtime N    modified N
>     days ago
>          -newer FILE    newer mtime than FILE     -mindepth # at least #
>     dirs down
>          -depth         ignore contents of dir    -maxdepth # at most #
>     dirs down
>     +    -inum  N       inode number N
>          -type [bcdflps] (block, char, dir, file, symlink, pipe, socket)
> 
>          Numbers N may be prefixed by a - (less than) or + (greater than):
>     @@ -341,6 +342,9 @@
>                test = compare_numsign(new->st.st_size, 512, ss[1]);
>            } else if (!strcmp(s, "links")) {
>              if (check) test = compare_numsign(new->st.st_nlink, 0, ss[1]);
>     +      } else if (!strcmp(s, "inum")) {
>     +        if (check)
>     +          test = compare_numsign(new->st.st_ino, 0, ss[1]);
>            } else if (!strcmp(s, "mindepth") || !strcmp(s, "maxdepth")) {
>              if (check) {
>                struct dirtree *dt = new;
> 
> 
> 
> 
> -- 
> Elliott Hughes - http://who/enh - http://jessies.org/~enh/
> Android native code/tools questions? Mail me/drop by/add me as a reviewer.
> 
> 
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
> 

 1436511498.0


More information about the Toybox mailing list