> 
> On Tue, 2004-07-06 at 11:47, Wiggins d Anconia wrote:
> 
> > 
> > I suspected it might be a buffering problem, and the docs for
> > GnuPG::Interface state in the FAQ:
> > 
> > "When having GnuPG process a large message, sometimes it just hanges
> there.
> > 
> >     Your problem may be due to buffering issues; when GnuPG
> reads/writes
> > to non-direct filehandles (those that are sent to filehandles which
> you
> > read to from into memory, not that those access the disk), buffering
> > issues can mess things up. I recommend looking into "options" in
> > GnuPG::Handles."
> 
> I looked into the "options" in GnuPG::Handles and the only option that
> can be set is 'direct'. But when I set direct to true on the filehandles
> it gave me a bunch of errors about un-open filehandles:
> 
> print() on unopened filehandle GEN0 at ./decrypt-ehs.pl line 42, <GEN5>
> line 1.
> print() on unopened filehandle GEN0 at ./decrypt-ehs.pl line 42, <GEN5>
> line 2.
> print() on unopened filehandle GEN0 at ./decrypt-ehs.pl line 42, <GEN5>
> line 3.
> print() on unopened filehandle GEN0 at ./decrypt-ehs.pl line 42, <GEN5>
> line 4.
> print() on unopened filehandle GEN0 at ./decrypt-ehs.pl line 42, <GEN5>
> line 5.
> print() on unopened filehandle GEN0 at ./decrypt-ehs.pl line 42, <GEN5>
> line 6.
> print() on unopened filehandle GEN0 at ./decrypt-ehs.pl line 42, <GEN5>
> line 7.
> 
> 
> > 
> > Your code did not appear to turn off buffering for the handles, can
> you
> > try this and see if it fixes the issue? I tested G::I on much bigger
> > files fo1r performance issues without problems, but always used
> > unbuffered handles.
> 
> Could you please tell me how you turned off buffering for the
> filehandles?
> 
> 

'direct' is slightly different, I am not sure there is a way to do this
in the options to G::I, but should instead be done directly to your
handles, I am also not sure of a way to specify non-buffered during
handle instantiation. You can call 'autoflush' on each of the handles
with a true argument, for instance,

foreach my $handle ( $input, $output, $error, $passphrase_fh, $status_fh ) {
  $handle->autoflush(1);
}

Should do the trick with the handles you created.  You may need to call
it on $cipherfile as well. 

perldoc IO::Handle for more on 'autoflush'

Alternatively you should be able to use the standard 1 argument form of
'select' with $| to set it, but since you have the objects already might
as well use their interface.

HTH,

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to