bug-findutils
[Top][All Lists]
Advanced

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

Re: Hi small improvement to find command.


From: Eric Blake
Subject: Re: Hi small improvement to find command.
Date: Tue, 29 Jan 2013 13:18:20 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 01/29/2013 01:24 AM, Prashant Sharma wrote:

[Please don't top-post on technical lists]

> The need for this arose with following scenario.
> I have stream processing engine doing some random stuff and creating a lot
> of files in the process. And since I did not wrote it myself and people who
> wrote it do not have clearing up mechanism for the files that accumulate
> and tend to either fill Inodes or File-system.
> 
> So needed a way for clearing things up older than 30 seconds. Ofcourse I
> can touch a dummy file and then sleep for 30 seconds and then use find
> -newer.

Why not just touch the file 30 seconds into the past to begin with?
There's no need to sleep, since touch is for more than just the current
timestamp.

> But that sounds like so much for so less and for that matter, one
> can parse the output of stat in perl or even in bash and do the same thing.
> In this case a single line command might sound like an improvement.

Consider - we gave you a solution (with touch and -newer) that works now
(and complies with POSIX), vs. the delay of waiting for adding a new
extension feature and percolating it into your distro (probably a
process of a couple of years, even if we do decide to enhance find, and
even then, limits you to GNU find instead of POSIX).  It's hard to
justify adding a new feature if existing standard features already work
without too much additional effort.

However, you are correct that we can add suffix parsing to -mtime
without violating POSIX, so it might make a nice syntactic sugar
addition.  If you are willing to write the patch, including
documentation and testsuite additions, your proposal will get a lot
further.  But for now, it appears that no one else is interested in
implementing it on your behalf.

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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