From: Guillaume Marcais Date: 2006-09-17T00:39:13+09:00 Subject: Re: IO#dup Le 16 sept. 06, � 09:51, ts a �crit : >>>>>> "G" == Guillaume Marcais writes: > > G> How to do the same thing in Ruby? There is no IO#dup or IO#dup2. > Only > G> IO#reopen. > > moulon% ruby -e 'p $stdin,$stdin.dup' > # > # > moulon% Duh! I got confused by the documentation. ri IO#dup doesn't return anything and I thought that IO#dup would be Object#dup, i.e. it would not do a file descriptor dup. But it does: [gus@genome1] 1 1 ~% ruby -e 'p $stdin.fileno,$stdin.dup.fileno' 0 3 Greping the source of Ruby for rb_cIO, I cannot find the place where IO#dup is defined in the IO class. I do see the function ruby_dup, but this is an internal function that works on int, not VALUE. I am confused... Could the ri documentation be fixed? I would summit a patch if I knew where to insert the documentation... Thanks Guy. Guillaume. > -- > > Guy Decoux > >