-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Maybe the module should respect (i.e. forward) that IO layers on the standard handles
when it reopens them?
Example:
use feature qw(say);
use strict;
use warnings;
use open qw/:std IN :encoding(utf-8) OUT :utf8/;
use Cwd qw(getcwd);
use Proc::Daemon;
say join ' ', (PerlIO::get_layers(\*STDOUT));
my $work_dir = getcwd;
my $daemon = Proc::Daemon->new(
work_dir => $work_dir,
child_STDOUT => 'stdout.txt',
child_STDERR => 'stderr.txt',
pid_file => 'pid.txt',
);
my $pid = $daemon->Init();
if ( $pid == 0 ) {
say join ' ', (PerlIO::get_layers(\*STDOUT));
}
The output from the script is:
unix perlio utf8
but the output to file stdout.txt is missing the utf8 layer:
unix perlio
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels