I am using Build 623. My code is given below. Basically, for processing I
need to create some temp files. After I use them, I want to delete the file.
But the unlink does not work.


require 'AddHeaderToBody.pl';
require 'AddFooterToBody.pl';

$argvLen = @ARGV ;

$inputDir = $ARGV[0] ;
$outputDir = $ARGV[1] ;
$templateDir = $ARGV[2] ;

$argvLen == 3 || die "Insufficient arguments , USAGE:\n PostProcess.pl
<Input directory> <Output Directory> <Template Directory>" ;

# Need to make sure that output directory exists
 (-d $outputDir ) || die "$outputDir does not exist" ;
 (-d $templateDir) || die "$templateDir does not exist" ;

# Need to have a tempfile for processing
$tempFile0 = "postProcesstemp.tmp0" ;
while ( -e $tempFile0){
        $tempFile0 = "$tempFile0" . ".0" ;
}

print "Final tempFile0 = $tempFile0 \n" ;

# Need to have second tempfile
$tempFile1 = "postProcesstemp.tmp1" ;
while ( -e $tempFile1){
        $tempFile1 = "$tempFile1" . ".1" ;
}

print "Final tempFile1 = $tempFile1\n" ;

#We need to look into all jsp files in the input directory


while ($nextName = <$inputDir/*.jsp> ){
        #We have got the input jsp file - we need to add header to it
    print "\nProcessing $nextName ..." ;
        $justFileName = $nextName ;
    $justFileName =~ s#.*/## ;
    $tempfile =
&addHeaderToBody($nextName,"$templateDir/Header.txt","$tempFile0") ;

    &addFooterToBody($tempFile, "$templateDir/Footer.txt",
"$outputDir/$justFileName" ) ;

    unlink($tempFile0) ;

#    if ( -e $tempFile0) {
#       die "$tempFile0 still exists!!!" ;
#    }
#    die "postProcesstemp.tmp0 was deleted" ;

}

-----Original Message-----
From: Timothy Johnson [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 18, 2002 5:21 PM
To: 'Anshul Chhabra'; beginner perl
Subject: RE: unlink in ActiveState Perl 5.6.0



What build are you using?  You should probably be using ActivePerl 5.6.1
build 633.  I've used unlink on Win32 with no problems.  Perhaps you can
post your code?

-----Original Message-----
From: Anshul Chhabra [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 18, 2002 5:18 PM
To: beginner perl
Subject: unlink in ActiveState Perl 5.6.0


Hi all
   Has anybody used unlink in ActiveState Perl 5.6.0 (on Windows)? It does
not seem to be working for me.

thanks in advance
Anshul



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to