1 2 3 4 5 6 7 8
fd = ARGV.shift.to_i f = File.for_fd fd begin f.write "writing to fd: #{fd}" ensure f.close end