Hi, I’m somewhat of a newbie, so bear with me if these questions are
stupid/frequently asked.
First, I have a program that I’m using to try and communicate with
mpg321 (a GPLd clone of mpg123, a UNIX mp3 player) at
http://www.sacredchao.net/debian/server.rb and
http://www.sacredchao.net/debian/test.rb (not in this mail because
server.rb, where the problem is, is pretty long). test.rb takes a song
to play as a parameter and then pauses/unpauses it a few times to test
it. Except when I try to pause/unpause, mpg321 reports an error that
looks like “@E Unknown command ‘s.mp3’” or some other string that’s a
truncated version of the filename I gave it to load. If I attach the
FIFO to stdout instead of mpg321, I don’t see any weird filenames, and
also, I also see this truncation problem when I send an EOF to mpg321 at
a tty. Is my code sending spurious EOFs somewhere?
Dealing with the same program, but a more general question - right now I
popen the mpg123 process for write, and redirect output to a FIFO, which
I open for reading. In Perl, I’d use IPC::Open2; does Ruby have a
similar function in the standard libraries, or is there a more canonical
way than what I’m doing now (e.g. pipe and fork)?
Thanks!
···
–
- Joe Wreschnig piman@sacredchao.net - http://www.sacredchao.net
"What I did was justified because I had a policy of my own… It’s
okay to be different, to not conform to society."
– Chen Kenichi, Iron Chef Chinese