O'Reilly logo

Practical Ruby for System Administration by André Ben Hamou

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Building Files the Smart Way

One of the most brilliant design choices found in UNIX-style operating systems is the notion that "everything is just a file." In other words, if your programming language can do very basic reading/writing of files and a little string handling, you can drive the configuration and environment of every bit of software you care about.

In this chapter, we will explore the most common file-building methodologies and find out how to apply them the Ruby way. In particular, before getting down to writing a single byte, we'll discuss and create some safe file operations. Such operations are imperative in system maintenance and administration scripts. Thus we will deal with the safety issues before proceeding to discuss ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required