ruby-changes:13461
From: akr <ko1@a...>
Date: Mon, 5 Oct 2009 20:27:17 +0900 (JST)
Subject: [ruby-changes:13461] Ruby:r25236 (trunk): rdoc update.
akr 2009-10-05 20:27:06 +0900 (Mon, 05 Oct 2009) New Revision: 25236 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25236 Log: rdoc update. Modified files: trunk/io.c Index: io.c =================================================================== --- io.c (revision 25235) +++ io.c (revision 25236) @@ -6289,7 +6289,7 @@ * * Returns a new <code>IO</code> object (a stream) for the given * <code>IO</code> object or integer file descriptor and mode - * string. See also <code>IO#fileno</code> and + * string. See also <code>IO.sysopen</code> and * <code>IO.for_fd</code>. * * === Parameters @@ -6334,7 +6334,8 @@ * * === Example1 * - * a = IO.new(2,"w") # '2' is standard error + * fd = IO.sysopen("/dev/tty", "w") + * a = IO.new(fd,"w") * $stderr.puts "Hello" * a.puts "World" * @@ -6344,10 +6345,15 @@ * World * * === Example2 - * io = IO.new(2, mode: 'w:UTF-16LE', cr_newline: true) + * + * require 'fcntl' + * + * fd = STDERR.fcntl(Fcntl::F_DUPFD) + * io = IO.new(fd, mode: 'w:UTF-16LE', cr_newline: true) * io.puts "Hello, World!" * - * io = IO.new(2, mode: 'w', cr_newline: true, external_encoding: Encoding::UTF_16LE) + * fd = STDERR.fcntl(Fcntl::F_DUPFD) + * io = IO.new(fd, mode: 'w', cr_newline: true, external_encoding: Encoding::UTF_16LE) * io.puts "Hello, World!" * * both of aboves print "Hello, World!" in UTF-16LE to standard error output with -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/