capture gpg return value

Mark Ivs markivs2003 at
Tue Jan 18 15:03:19 CET 2005

Is there a way to know if the encryption was
successful? I tried the following...
$errorval = 'gpg --recipient "XXX" --output
$rootpath\\output\\$filepgp --encrypt

if($errorval) {
	do something....

errorval doesn't seem to have any value, so it never
goes into the if statement.
The problem I am facing is, when the output folder
already has the encrypted files(from previous run), I
get the following error on the console.

"gpg: myfile.csv: encrypt failed: file exists"

I want to capture that error inside my if statement
and log it.

Thanks in advance.


Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less.

More information about the Gnupg-users mailing list