13 DIRECTORIES AND FILES

Interacting with the directories and files found on the computer is a standard use of nearly every programming language. As with many things in Ruby, once you’re familiar with the basic concepts, directory- and file-related tasks are easily undertaken, with a minimum of code. And, of course, there are several ways you can go about most operations.

This chapter begins by covering the basic information you’ll need to know to follow the examples herein. Next, you’ll see how to view the contents of a directory. The following two subjects discuss various directory and file properties, like their size, modification times, and permissions. Then you’ll see how to create, move, copy, and delete both directories and files. The ...

Get Ruby: Visual Quickstart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.