Solved

(-A "file"....  command

Posted on 1998-10-07
1
165 Views
Last Modified: 2010-03-05
With the following routine sometimes it pushes files
even if they are older than 10 minutes..

if ((-A "$file_dir/$file" < 600 / 86400) && ($file !~ /^data/) && ($file ne "lock") && ($file ne "vis") && ($file ne "vis1") && ($file ne "vis2") && ($file ne "vis3") && ($file ne "vis4")) {
push (@cleanfilelist,$file);



Is there another command as (-A "$file_dir/$file" < 600 / 86400) to
select only files not older than 10 minutes?
0
Comment
Question by:Bigi
1 Comment
 
LVL 5

Accepted Solution

by:
b2pi earned 100 total points
ID: 1205180
You don't say what OS you're using, but try using -M rather than -A
There's often a difference on unix boxes. To see this, execute the
following code:

opendir(A, ".");
@files = readdir(A);
closedir(A);
foreach (@files) {
        next if m/^\./;
        $A = -A $_;
        $M = -M _;
        next if $A == $M;
        print "$A\t$M\t$_\n";
}
 

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now