Open scovit opened 4 years ago
Does perl6 -e '$*OUT.flush'
produce the same error?
Negative: it does not produce any error
Hm, OK. What about if it's $*ERR
? Also, what if it's:
perl6 -e 'react { my $p = Proc::Async.new("perl6", "-e", "\$*OUT.flush"); whenever $p.stdout { }; whenever $p.start { } }'
Good golf!
$ perl6 -e 'react { my $p = Proc::Async.new("perl6", "-e", "\$*OUT.flush"); whenever $p.stdout { }; whenever $p.start { } }'
Cannot flush handle: Failed to flush filehandle: Operation not supported
in block
$*ERR is not a problem
$ perl6 -e '$*OUT.flush' | cat
Cannot flush handle: Failed to flush filehandle: Operation not supported
in block
Seems like a moarvm bug to me.
Since flush is implemented as fsync in moarvm, but..
$ perl6 -e 'use NativeCall; sub fsync(int32 --> int32) is native { }; say fsync(1)' | cat returns -1.
which is right. Since pipes are not synchronous.
Hm, though it seems to work out on various platforms. I wonder what it should be using...
C fflush is a no-op on pipes.
I suspect that the linux kernel fsync on pipes is also a no-op, on Mac (and possibly freebsd) it returns errors.
Sorry I cannot help you in deciding what it should be. I am not enough a POSIX expert
Then,
Then open a web browser, http://localhost:20000
The page does not show, on the shell the following error:
⚠ hello Cannot flush handle: Failed to flush filehandle: Operation not supported ⚠ hello in block at /usr/local/Cellar/rakudo/2019.07.1/share/perl6/site/sources/794E18F5F4F80DEE905DE049F8655401F940C814 (Cro::HTTP::Log::File) line 28 ⚠ hello in block at /usr/local/Cellar/rakudo/2019.07.1/share/perl6/site/sources/D69ADAA9BE77DD33B9702EA1BCD4D35E6379EA88 (Cro::HTTP::Internal) line 45 ⚠ hello in block at /usr/local/Cellar/rakudo/2019.07.1/share/perl6/site/sources/9A69BC70F2D8C7BD950C926E19009FF093ED8524 (Cro::HTTP::Router) line 232 ⚠ hello