RE: Checking to see if file exists.
- From: tvadnais@xxxxxxxxxxxxx (Tvadnais)
- Date: Tue, 29 Jul 2008 19:49:01 -0700
Oops, thank you for catching that... I haven't gotten that far in my
debugging.
Unfortunately, my problem was with the "if (-e $filename)" always returning
false. In the code I'm testing, I have the pgp commented out, because I
can't actually unencrypt the files because pgp can only be run by root.
Thank you,
Tim
-----Original Message-----
From: Mr. Shawn H. Corey [mailto:shawnhcorey@xxxxxxxx]
Sent: Tuesday, July 29, 2008 7:39 PM
To: tvadnais@xxxxxxxxxxxxx
Cc: beginners@xxxxxxxx
Subject: RE: Checking to see if file exists.
On Tue, 2008-07-29 at 19:06 -0700, tvadnais wrote:
Here is the true code if that helps:
I've tried:
foreach my $file ( @currset )
{
my $tmpstr = substr ($file, 0, index($file, ".pgp"));
print ("trying to delete $tmpstr \n");
## pgp will core dump if there's already an unencrypted file
## with the destination source name... So we have to remove the
## previously decrypted file if it exists.
unlink ($tmpstr);
$tmpstr = "/usr/local/bin/pgp -z 'Chars process for WSHA' $file";
if (system($tmpstr) == 0) {
$notice .= LogMsg (MSG => "system $tmpstr failed: $?", DEBUG =>
$debug);
system() returns zero for success. See `perldoc -f system`.
--
Just my 0.00000002 million dollars worth,
Shawn
"Where there's duct tape, there's hope."
"Perl is the duct tape of the Internet."
Hassan Schroeder, Sun's first webmaster
.
- Follow-Ups:
- RE: Checking to see if file exists.
- From: Mr. Shawn H. Corey
- RE: Checking to see if file exists.
- References:
- Checking to see if file exists.
- From: Tvadnais
- Re: Checking to see if file exists.
- From: Kenneth Wolcott
- RE: Checking to see if file exists.
- From: Tvadnais
- RE: Checking to see if file exists.
- From: Tvadnais
- RE: Checking to see if file exists.
- From: Mr. Shawn H. Corey
- Checking to see if file exists.
- Prev by Date: RE: Checking to see if file exists.
- Next by Date: RE: Checking to see if file exists.
- Previous by thread: RE: Checking to see if file exists.
- Next by thread: RE: Checking to see if file exists.
- Index(es):
Relevant Pages
|