FIFO IPC questions


(Joe "piman" Wreschnig) #1

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!

···


(Evan Martin) #2

Hey Joe! :slight_smile:

Though this isn’t a direct answer to your question, it appears we’ve had
some similar ideas.

Check out ruby-vorbisfile:
http://rikkus.info/ruby_vorbisfile.html

or, to cut to the chase:
http://www.livejournal.com/talkread.bml?journal=evan&itemid=495337

···

On Sat, Jun 08, 2002 at 09:04:46AM +0900, Joe Wreschnig wrote:

Hi, I’m somewhat of a newbie, so bear with me if these questions are
stupid/frequently asked.


Evan Martin
martine@cs.washington.edu
http://neugierig.org