in reply to Re: Win32: Setting a layer with binmode causes problem with close() on Windows
in thread Win32: Setting a layer with binmode causes problem with close() on Windows
and I getprint join ' ', 1, PerlIO::get_layers($fh), "\n"; binmode($fh, ':raw:perlio') or warn "UHOH $! \n$^E \n$@\n "; print join ' ', 2, PerlIO::get_layers($fh), "\n"; binmode($fh, ':raw') or warn "UHOH $! \n$^E \n$@\n "; print join ' ', 3, PerlIO::get_layers($fh), "\n"; binmode($fh, ':raw:raw:raw:raw') or warn "UHOH $! \n$^E \n$@\n "; print join ' ', 4, PerlIO::get_layers($fh), "\n"; binmode($fh, ':raw:raw:raw:raw:unix:crlf') or warn "UHOH $! \n$^E \n$@ +\n "; print join ' ', 5, PerlIO::get_layers($fh), "\n"; for(1..3){ binmode($fh, ':raw:pop') or warn "UHOH $! \n$^E \n$@\n "; print join ' ', 6, PerlIO::get_layers($fh), "\n"; } #~ binmode($fh, ':raw:crlf:perlio') or warn "UHOH $! \n$^E \n$@\n "; binmode($fh, ':pop:pop:win32') or warn "UHOH $! \n$^E \n$@\n "; print join ' ', 6, PerlIO::get_layers($fh), "\n";
in addition to the file-already-open1 unix crlf 2 unix crlf perlio 3 unix crlf perlio 4 unix crlf perlio 5 unix crlf perlio unix crlf 6 unix crlf perlio unix 6 unix crlf perlio 6 unix crlf 6 win32
if turning off unix and turning it on again, or turning it on twice, is wrong, perl should warn or die
PerlIO seems thin, OTOH, the test suite lists a TODO #56644: PerlIO resource leaks on open() and then :pop in :unix and :stdio but its closed
Any way you look at it there is nonsense around :)
|
|---|