From: Robert Klemme Date: 2007-03-20T02:25:21+09:00 Subject: Re: Passing File Descriptors? On 19.03.2007 17:43, Worky Workerson wrote: > Is there a ruby way to pass file descriptors to separate processes? > I'm thinking of interfacing with a C program, which uses the > SCM_RIGHTS cmsg over a unix-domain socket ... is this idiom > implemented in Ruby? How would I marshall an IO object into (and out > of) the integer file descriptor, or does this "just work"? Untested: You can determine the descriptor id via io.fileno. The you can pass that to the child process via main's args when you exec after fork. Then the child should be able to reuse that descriptor. Alternatively you can of course transport the descriptor id via an environment variable. Kind regards robert