Programming With Ruby Episode 13, Basic I/O Covered in this
Episode: - Defining I/O Hello Everybody and welcome to
Programming With Ruby Episode 13, Basic input output. As always,
I’m Tyler and this video is brought to you by In this episode I
will be defining what exactly input/output is, You will also
learn how to work with files and directories in Ruby Lets get
started! So what exactly is I/O or input/output. Basically Input
is any data that you receive from the user, and output is what
data you give to the user, usually based on what input the user
gave you. In this episode you will be seeing I/O as working with
files and directories. You have already worked with I/O
previously when we talked about getting strings from the user
(gets) and printing string to the screen (puts) There are a
couple of ways to start working with files. The first is by
using File.new: my_file = File.new('file', 'r') my_file.close
File.new opens the file (the first parameter), for the specified
mode (the second parameter) The fil