--8V+6LrNBE4S2A03oMlo
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Thu, 2002-07-11 at 15:17, Maggie Xiao wrote:
> Hi,
> 
> Is there anyone can tell me how to make FIFO in ruby? I cannot find the 
> related method? Thanks.

I did something like this a while back:

class File
  def self.mkfifo(name, mode="0600", open_mode="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=" + mode, name)
      @@created_fifos << name
    end

    return File.open(name, open_mode)
 
-- 
 - 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

--8V+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+rAPj
-----END PGP SIGNATURE-----

--8V+6LrNBE4S2A03oMlo--