module POSIX::Spawn

def default_file_reopen_info(fd, file)

Returns a [file, flags, mode] tuple.

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

stderr default to write, while stdin and all other fds default to read.
default flags vary based on the what fd is being redirected. stdout and
The default [file, flags, mode] tuple for a given fd and filename. The
def default_file_reopen_info(fd, file)
  case fd
  when :in, STDIN, $stdin, 0
    [file, "r", 0644]
  when :out, STDOUT, $stdout, 1
    [file, "w", 0644]
  when :err, STDERR, $stderr, 2
    [file, "w", 0644]
  else
    [file, "r", 0644]
  end
end