From: Joe Wreschnig Date: 2002-07-14T13:23:26+09:00 Subject: Re: new to ruby,how to make FIFO in ruby? --=-N8V+6LrNBE4S2A03oMlo Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, 2002-07-11 at 15:17, Maggie Xiao wrote: > Hi, >=20 > Is there anyone can tell me how to make FIFO in ruby? I cannot find the=20 > related method? Thanks. I did something like this a while back: class File def self.mkfifo(name, mode=3D"0600", open_mode=3D"rw") if ! File.writeable? File.dirname(name) raise Errno::EACCES, "No such directory" end if File.exists? name and File.pipe? name # Leftover from before File.delete name end if ! File.exists? name system("mkfifo", "--mode=3D" + mode, name) @@created_fifos << name end return File.open(name, open_mode) =20 --=20 - Joe Wreschnig - 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 --=-N8V+6LrNBE4S2A03oMlo Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQA9MPy7TFkUq7Drx3cRAoA/AKClkv8D+TpSgO/prjxI57c/ql/I/wCgrVY5 F5kJnvjOAAFpPlt8NHdg+rA= =KsPj -----END PGP SIGNATURE----- --=-N8V+6LrNBE4S2A03oMlo--