bug-findutils
[Top][All Lists]
Advanced

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

Re: Question on "enhancements wanted for findutils"


From: James Youngman
Subject: Re: Question on "enhancements wanted for findutils"
Date: Sat, 2 Apr 2011 21:27:13 +0100

On Sat, Sep 11, 2010 at 3:25 AM, Nick <address@hidden> wrote:
> On 2010-09-04 11:36, James Youngman wrote:
>> On Thu, Sep 2, 2010 at 1:01 AM, Nick <address@hidden> wrote:
>> >  - the item 'Add tests which allow [acm]time to be compared against a
>> >   specified timestamp' seems already available by using -newerXt, or
>> >   do I misunderstand?
>>
>> I guess "tests" is a little ambiguous.   The regression test suite
>> does not test -mtime and friends, but it should.
>
> Is this along the right lines?  I started with 'amin' because it's at
> the top of excuses.txt.

I've long avoided doing it like that for what's probably a stupid
reason; what if the script takes more than 3 minutes to run?
(Clearly in this case is just won't on any reasonable system so I
think your approach can work).

>   $ pwd
>   /home/nick/findutils/find
>
>   $ cat testsuite/find.gnu/amin.exp
>
>   exec rm -rf tmp.amin
>   exec mkdir tmp.amin
>
>   # Touch the files in the setup phase, to make sure sec_since_epoch
>   # is as recent as possible.
>   proc prep {} {
>       set sec_since_epoch [clock seconds]
>       for {set i 0} {$i < 10} {incr i} {
>           set sec [expr $sec_since_epoch - 60 * $i]
>           exec touch address@hidden tmp.amin/min-$i.test

Unfortunately this relies on GNU touch.   Writing test scripts in
expect is a bit of a pain, and not having a utimes builtin is a
problem here.

>       }
>   }
>   find_start p { tmp.amin -type f -amin -3 } "" "" prep
>
>   exec rm -rf tmp.amin
>
>   $ cat testsuite/find.gnu/amin.xo
>   tmp.amin/min-0.test
>   tmp.amin/min-1.test
>   tmp.amin/min-2.test
>
> Thanks
> --
> Nick
>
>
>



reply via email to

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