-
Notifications
You must be signed in to change notification settings - Fork 19
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
Does only capture part of output #10
Comments
What is RRDs and what is dump() doing? David On Thu, Jun 6, 2013 at 10:00 AM, Fabien Wernli notifications@github.comwrote:
David Golden dagolden@cpan.org |
RRDs provides the bindings for the C library to rrdtool (XS). It extracts the binary data from the rrd data file and exports it to an XML representation |
Sounds like rrdtool is doing something with filehandles directly instead of David On Thu, Jun 6, 2013 at 3:48 PM, Fabien Wernli notifications@github.comwrote:
David Golden dagolden@cpan.org |
I also tried IO::CaptureOutput with the exact same result. sub capture_stdout (&) {
my $pid;
my $fh;
unless ($pid = open $fh, "-|") {
die "Can't fork: $!" unless defined $pid;
shift->();
exit 0;
}
# the following is a noop, as it seems RRDs::dump already waits for its child
while (waitpid(-1, &WNOHANG) > 0) { sleep 1 }
return $fh;
}
my $fh = capture_stdout { RRDs::dump $ARGV[0] };
my $dump;
$dump .= $_ while <$fh>; |
I came across a case in which only part of STDOUT is being captured:
Output using any RRD file:
The ending of the file is still being sent to
STDOUT
.The rest of the file (the beginning) is correctly passed to
$dump
.The text was updated successfully, but these errors were encountered: