Working with the file system in Ruby


Not CompletedCreate a File with Ruby Tutorial

In this lesson, we are going to learn how to work with files in Ruby, including how to create, edit and append. This information can be particularly helpful when you want to store content on a text file, so that you don't have to rely on a database connection every time. It's good to have some practical knowledge on this.

Not CompletedHow to Read Files into a Ruby Program Using the File Class

Ruby does some cool things when it comes to reading from a file, and we are going to see it in this lesson.

Not CompletedHow to Delete a File in Ruby

Now that we know how to create a file and read from it, let's learn how to delete a file. It can be done with a single line of code.

Not CompletedHow to Append to the End of a File in Ruby

In this lesson we are going to learn something that is very practical: appending information to the end of a file. Typically, you may want to append information to a log file from time to time, and we'll see how to do this now.

Quizzes


Working with the file system in Ruby
    Unsupported Browser

    devCamp does not support ancient browsers.
    Install a modern version for best experience.