in reply to Re: ignore certain files in a folder search, and create a random .txt file
in thread ignore certain files in a folder search, and create a random .txt file
but now I get a warning based on the "." and "..", which I'd also like to ignore (I thought the first script I posted ignored that. Pardon me if I didn't append your code correctly...I'm obviously quite new to all this. Thanks for any input. Dave#!/bin/perl -w use strict; my $mytime=(time); my ($File,$FileStat,$CallOutDir); chdir 'C:/devl/bin/timedir' or die "Arghh!!! $!"; opendir(ROOT, ".") or die "Arghh!!! $!"; foreach $File (readdir(ROOT)) { next if $File=~/^\./; next if $File =~/\._Checking_File_Readiness_$/; # This is the *.fi +letype I want to ignore next if $File =~/\_Watched_Folder_Active_$/; # This is the single +file I'd also like to ignore if ($FileStat = (stat $File)[9]){ if ($FileStat <= ($mytime - 300)) { print "File older than 5min found. The file name is $File"; #send mail here.... last; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: ignore certain files in a folder search, and create a random .txt file
by tachyon (Chancellor) on Mar 19, 2004 at 21:18 UTC | |
by dkaplowitz (Novice) on Mar 19, 2004 at 21:38 UTC | |
by tachyon (Chancellor) on Mar 19, 2004 at 21:43 UTC | |
by dkaplowitz (Novice) on Mar 19, 2004 at 21:56 UTC | |
by tachyon (Chancellor) on Mar 19, 2004 at 22:03 UTC | |
by dkaplowitz (Novice) on Mar 23, 2004 at 15:07 UTC |