Reading and Writing to Files in Ruby

Much of the work of a backend developer is to build the structures that organize, analyze and pass around data. Unfortunately, your data will likely not all come in the same form, some may be from user input, some from an API, and some from CSVs. Reading and writing to files often trips up newer developers. I believe this may be due in part to the fact that a lot of the work is abstracted by Ruby. It feels like you need to do so much, but there aren’t that many methods you need to get the job done.

In the following video I review using Unix commands and Ruby methods to interact with files as well as a little ARGV.

Thanks for watching! If you’d like some follow up activities check out the File I/O lesson from Turing School of Software & Design.

Like what you read? Give Ali Schlereth a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.