TIEHANDLE.) The arguments are an optional mode string ("r", "w",
"w+", ...) and a filehandle for the PerlIO layer below. Mandatory.
+When layer is pushed as part of an C<open> call, C<PUSHED> will be called
+I<before> the actual open occurs whether than be via C<OPEN>, C<SYSOPEN>,
+C<FDOPEN> or by letting lower layer do the open.
+
=item $obj->POPPED([$fh])
Optional - layer is about to be removed.
-=item $class->OPEN($path,$mode[,$fh])
+=item $obj->OPEN($path,$mode[,$fh])
-Not yet in use.
+Optional - if not present lower layer does open.
+If present called for normal opens after layer is pushed.
+This function is subject to change as there is no easy way
+to get lower layer to do open and then regain control.
=item $obj->BINMODE([,$fh])
is pushed. If present it should return 0 on success -1 on error and undef
to pop the layer.
-=item $class->FDOPEN($fd)
+=item $obj->FDOPEN($fd[,$fh])
-Not yet in use.
+Optional - if not present lower layer does open.
+If present called for opens which pass a numeric file
+descriptor after layer is pushed.
+This function is subject to change as there is no easy way
+to get lower layer to do open and then regain control.
-=item $class->SYSOPEN($path,$imode,$perm,$fh)
+=item $obj->SYSOPEN($path,$imode,$perm,[,$fh])
-Not yet in use.
+Optional - if not present lower layer does open.
+If present called for sysopen style opens which pass a numeric mode
+and permissions after layer is pushed.
+This function is subject to change as there is no easy way
+to get lower layer to do open and then regain control.
=item $obj->FILENO($fh)
=cut
+
+
}
else {
PerlIO_debug("No next\n");
+ /* FIXME: How should this work for OPEN etc? */
}
PUTBACK;
count = call_sv((SV *) cv, flags);
f = NULL;
}
}
+ /* FIXME - Call an OPENED method here ? */
return f;
}
else {
+ PerlIO_debug("Open fail %s => %p->%p\n", tab->name,
+ PerlIONext(f), *PerlIONext(f));
/* Sub-layer open failed */
}
}
else {
+ PerlIO_debug("Nothing to open with");
/* Nothing to do the open */
}
+ PerlIO_pop(aTHX_ f);
return NULL;
}
}
}
+
+
+
my $tmp = "via$$";
-use Test::More tests => 15;
+use Test::More tests => 16;
my $fh;
my $a = join("", map { chr } 0..255) x 10;
BEGIN { use_ok('MIME::QuotedPrint'); }
+ok( !open($fh,"<Via(MIME::QuotedPrint)", $tmp), 'open QuotedPrint fails');
ok( open($fh,">Via(MIME::QuotedPrint)", $tmp), 'open QuotedPrint for output');
ok( (print $fh $a), "print to output file");
ok( close($fh), 'close output file');
END {
1 while unlink $tmp;
}
+