You need to make sure that something calls utime() to reset the filestamps.  
You can't reset the ctime (inode change time), but the atime (inode access 
time) and the mtime (inode timestamp) are changable.

Here is a simple example Perl script that works a little like grep:
--
#!/usr/bin/perl

use strict;

my ($regexp);

$regexp = shift @ARGV;

for my $filename (@ARGV) {
        my @stat = stat $filename or do {
                print STDERR "stat of $filename failed; $!\n";
                next;
        };

        open FILE, "<$filename" or do {
                print STDERR ("open of $filename for reading failed; "
                              ."$!\n");
                next;
        };

        while (<FILE>) {
                m/$regexp/ && print "$filename: $_";
        }

        close FILE;

        utime @stat[8,9], $filename or
                print STDERR "utime call of $filename failed; $!\n";
}
--
Cheers,
Sam.

On Sun, 31 Dec 2000 14:04:57 -0500
Maciej Kalisiak <[EMAIL PROTECTED]> wrote:

> Hello all,
> 
> Is it possible to grep a ton of files without modifying their date/timestamps?
> Currently if I use grep, it changes the access time of all files touched,
> which causes mutt to lose track of the folders which have new mail (I guess it
> looks at the timestamp last modified and last accessed to figure this out).
> Occasionally I do want to include the mail folders in my greps, so bypassing
> the "mail" directory is not a solution.
> 
> -- 
> Maciej Kalisiak               [EMAIL PROTECTED]       www.dgp.toronto.edu/~mac
> 
> 
> -- 
> To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
> 
> 
> 


--
Sam Vilain, [EMAIL PROTECTED]        WWW: http://sam.vilain.net/
GPG public key: http://sam.vilain.net/sam.asc

Reply via email to