in reply to Re^4: Check multiple file names exist in directory and create another trigger file after existing files processed
in thread Check multiple file names exist in directory and create another trigger file after existing files processed
Thank you, again. The issue is here reading each filename from the directory and do compare. If it matches process all three files and then create a new *.done file to process further. This script runs once a week so we do not worry about old files. because there will always be three files will dropped in the source folder where this script should look after at specific interval.
I made some changes as advised but it is not throwing any error but eventually end up with Exit code 0.$inputFileName = $ARGV[0]; $inputFilewithPath = $ARGV[1]; $destinationFileName = ""; $destinationFilePath = "\\mftshare-dev\Test\customoutput\Test1"; $triggerFileName = ""; my @zipfiles = glob "\\mftshare-dev\cpa\customoutput\hubidp\*.zip"; for my $file (@zipfiles) { if ($inputFileName =~ /alphat_(.*)\.zip/) { my $key = $1; # whatever was between alphat_ and the .zip bits. if (-f "numerict_${key}.zip" && -f "updatet_${key}.zip") { $destinationFileName = sprintf("%s%s%s", $destinationFilePath, + $inputFileName); $triggerFileName = sprintf("%s%s%s", $destinationFilePath , "c +pa_trigger.done"); $returnVal = system("ftmscmd /tcp /send /file /node:VIP /DT:B +/CrLf:Y /ppa1:S,L,COMMAND,\"echo > $triggerFileName\" /TC:3 $inputFil +ewithPath $destinationFileName"); } else { printf "WARNING: EXPECTED FILES NOT FOUND. INVESTIGATION REQUI +RED"; exit 8; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Check multiple file names exist in directory and create another trigger file after existing files processed
by roboticus (Chancellor) on Nov 22, 2017 at 21:02 UTC | |
|
Re^6: Check multiple file names exist in directory and create another trigger file after existing files processed
by vickycanada (Novice) on Nov 22, 2017 at 17:22 UTC |