in reply to Splitting output
It's been some years since I've worked with curses (nevermind ncurses), but you can probably throw together some sort of curses-based shell (in Perl, I'd imagine) which throws two windows up, sets up both of your processes writing into pipes, and alternates checking them/reading from them (using select from the socket API, I'd imagine to determine which to read from next).
# Something like this: use IO::Select; my $bladeenc_cmd = 'bladeenc -whatever args'; my $cdparanoia_cmd = 'cdparanoia -whatever else args'; open P1, "$bladeenc_cmd|" or die "bladeenc: $!"; open P2, "$cdparanoia_cmd|" or die "cdparanoia: $!"; local $SIG{PIPE} = sub { warn "pipe closed"; } my $s = IO::Select->new(); my $timeout = 100; # msec(?) $s->add(\*P1); $s->add(\*P2); my @ready; while (@ready = $s->can_read($timeout)) { foreach my $fh (@ready) { if ($fh == \*P1) { my $line = <$fh>; # write to first window } if ($fh == \*P2) { my $line = <$fh>; # write to second window } } } # you get the idea ...
Update: don't actually need Socket.pm. Added notation referring to bladeenc and cdparanoia command lines.
dmm
You can give a man a fish and feed him for a day ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Splitting output
by derby (Abbot) on Jan 11, 2002 at 19:22 UTC |