I have the following:
Basically if the job directory doesn't exist is should place the batfile in the P:\temp directory, but nothing seems to happen however. If the job directory does exist then it doesn't enter the unless statement (as expected).
Code:
$jobdir = 'P:\jobs';
# Added by PS
$batchdir = 'P:\temp';
$SEP ='\\';
$EXT = '_remove.bat';
$batfile = $jobdir . $SEP . $customer . $SEP . $department . $SEP . $documenttype . $SEP . $job . $SEP . 'projector' . $SEP . $batch . $EXT;
#open output file
#Modified to allow batch file to be written to temp directory
#should the job directory not exist 31/08/06 - PS
unless(open(BATFILE,">$batfile")) {
$batfile = $batchdir . $SEP . 'batch' . $EXT;
open(BATFILE,">$batfile") || die "Cannot open $batfile";
}
Basically if the job directory doesn't exist is should place the batfile in the P:\temp directory, but nothing seems to happen however. If the job directory does exist then it doesn't enter the unless statement (as expected).