New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tied filehandles not working with XS-based I/O #14888
Comments
From jdv@base2bio.comCreated by jdv@base2bio.comTied filehandles don't appear to be working as expected in combination Discussed at https://www.perlmonks.org/?node_id=1140411 A MWE example follows. The same behavior is observed using other ## BEGIN CODE #!/usr/bin/perl package TieTest; sub TIEHANDLE { return bless gensym(), shift; } package main; use strict; my ($testfile_0, $testfile_1) = @ARGV; open FH_PLAIN, '<', $testfile_0; #open FH_TIED, '<', $testfile_1; # try uncommenting this my %handles = (PLAIN => \*FH_PLAIN, TIED => \*FH_TIED); my $fh = $handles{$title}; my } Perl Info
|
From @tonycozOn Thu Sep 03 15:50:47 2015, jdv@base2bio.com wrote:
This isn't a bug. PerlIO is the layer below the I/O you see at the perl level, by the time you have a PerlIO * value, the tied information (stored in the GV) isn't available. If you do want your interface visible at the PerlIO level you'll need to implement it as a PerlIO layer, possibly using PerlIO::via. Unfortunately there's no simple XS interface for performing I/O on a GV that honors tie() - I've done it by switching between a callback that uses PerlIO vs a callback that uses call_sv() to call back to perl subs that print/read/seek as needed. Which won't help you for Digest::MD5. Tony |
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Sun Sep 13 18:50:34 2015, tonyc wrote:
Closing. Tony |
@tonycoz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#125981 (status was 'resolved')
Searchable as RT125981$
The text was updated successfully, but these errors were encountered: