[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #15037] [Wishlist] find -ls isn't flexible enough but can't be emul

From: Lenny Foner
Subject: [bug #15037] [Wishlist] find -ls isn't flexible enough but can't be emulated via -printf
Date: Wed, 23 Nov 2005 07:47:20 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Firefox/1.0.7 (Ubuntu package 1.0.7)

Follow-up Comment #2, bug #15037 (project findutils):

Yikes, I hadn't even considering the symlink case, probably because the
scripts I was using couldn't handle symlinks anyway and were ignoring
them---hence the whole problem didn't come up.

Assuming that I haven't forgotten anything else, I see two ways to do this:

(a) create two new format directives, one of which prints timestamps exactly
as -ls does (should be trivial, since you can just reuse the same code), and
one which handles the symlink case (either your idea of expanding into " ->
foo" or nothing, or possibly something that prints the entire pathname, e.g.,
it prints either "bar" or "bar -> foo", depending on whether or not bar is a

(b) start adding options to -ls, e.g., for numeric uid/gid, for octal instead
of symbolic modes, etc.  This isn't as flexible as (a) but might be easier to
use in the case that originally bit me, namely needing to get those numeric
uid/gid's into -ls output.

I'm not exactly sure what behavior you're implying in your paragraph about
%{foo}, so I'm not sure if that sounds reasonable to me.  A compromise in
complexity might be to do what was done with printing bits and pieces of
times and dates, namely two-character format directives; in that case, %p
might be "pathname" and %pl might be "pathname or pathname pointing at
symlink" (or perhaps %pl might be "null or  '-> foo'", so you'd write
something like %p%pl in the format string).

As for printing times in the same format as -ls, maybe that could be yet
another second-letter option to %T?  That's not terribly orthogonal to the
others (each of which is a tiny little chunk of a complete timestamp), so
maybe there's a better way of doing that.  I hope so.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]