kernel/common/process_mirror.rb
def default_file_reopen_info(fd, file)
          case fd
          when :in, ::STDIN, $stdin, 0
            [file, OFLAGS["r"], 0644]
          when :out, STDOUT, $stdout, 1
            [file, OFLAGS["w"], 0644]
          when :err, STDERR, $stderr, 2
            [file, OFLAGS["w"], 0644]
          else
            [file, OFLAGS["r"], 0644]
          end
        end
# The default [file, flags, mode] tuple for a given fd and filename. The
# default flags vary based on the what fd is being redirected. stdout and
# stderr default to write, while stdin and all other fds default to read.
#
# fd   - The file descriptor that is being redirected. This may be an IO
#        object, integer fd number, or :in, :out, :err for one of the standard
#        streams.
# file - The string path to the file that fd should be redirected to.
#
# Returns a [file, flags, mode] tuple.
The default [file, flags, mode] tuple for a given fd and filename. The
default flags vary based on the what fd is being redirected. stdout and
stderr default to write, while stdin and all other fds default to read.

fd   - The file descriptor that is being redirected. This may be an IO
object, integer fd number, or :in, :out, :err for one of the standard
streams.
file - The string path to the file that fd should be redirected to.

Returns a [file, flags, mode] tuple.
The default [ file flags mode ] tuple for a given fd and filename . The default flags vary based on the what fd is being redirected . stdout and stderr default to write while stdin and all other fds default to read . fd - The file descriptor that is being redirected . This may be an IO object integer fd number or : in : out : err for one of the standard streams . file - The string path to the file that fd should be redirected to . Returns a [ file flags mode ] tuple .
def default_file_reopen_info(fd, file)
          case fd
          when :in, ::STDIN, $stdin, 0
            [file, OFLAGS["r"], 0644]
          when :out, STDOUT, $stdout, 1
            [file, OFLAGS["w"], 0644]
          when :err, STDERR, $stderr, 2
            [file, OFLAGS["w"], 0644]
          else
            [file, OFLAGS["r"], 0644]
          end
        end
def default_file_reopen_info ( fd , file ) case fd when :in , :: STDIN , $stdin , 0 [ file , OFLAGS [ "r" ] , 0644 ] when :out , STDOUT , $stdout , 1 [ file , OFLAGS [ "w" ] , 0644 ] when :err , STDERR , $stderr , 2 [ file , OFLAGS [ "w" ] , 0644 ] else [ file , OFLAGS [ "r" ] , 0644 ] end end
The default [file, flags, mode] tuple for a given fd and filename.
The default [ file flags mode ] tuple for a given fd and filename .
fd
file