Hello,

I'm porting a program from unix, and I'm having problems with the handles.

Here's my script :

use strict;
use IO::Handle;
use GnuPG::Interface;

##
##
sub gnupg_handles() {
       my %fds = (
               stdin  => IO::Handle->new(),
               stdout => IO::Handle->new(),
               stderr => IO::Handle->new(),
       );

       my $handles = GnuPG::Handles->new(%fds);

       return ( $fds{'stdin'},  $fds{'stdout'}, $fds{'stderr'}, $handles );
}

my $gnupg;

my $pid;

#
$gnupg = GnuPG::Interface->new();

$gnupg->options->hash_init( armor => 1 );
$gnupg->options->meta_interactive( 0 );
#$gnupg->options->batch( 1 );
#$gnupg->options->quiet( 1 );


my ( $entree_fd, $sortie_fd, $erreur_fd, $handles) = gnupg_handles();

$pid = $gnupg->list_public_keys( handles => $handles );

my ( @sortie, @erreur );
@sortie = <$sortie_fd>;
@erreur = <$erreur_fd>;

waitpid $pid, 0;

close( $sortie_fd );
close( $erreur_fd );

if( @sortie ) {
       print "STDOUT :\n";
       print join( "\n", @sortie );
}

if( @erreur ) {
       print "STDERR :\n";
       print join( "\n", @erreur );
}

This runs fine on unix, but hangs on windows.
No error, no message, nothing.

Can anyone help me ?

Thanks

Loic BRYCKAERT

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to