October 2006
Intermediate to advanced
888 pages
16h 55m
English
When we say file, we usually mean a disk file, though not always. We do use the concept of a file as a meaningful abstraction in Ruby as in other programming languages. When we say directory, we mean a directory in the normal Windows or UNIX sense.
The File class is closely related to the IO class from which it inherits. The Dir class is not so closely related, but we chose to discuss files and directories together because they are still conceptually related.
The class method File.new, which instantiates a File object also opens that file. The first parameter is naturally the filename.
The optional second parameter is called the mode string, telling how to open the file ...
Read now
Unlock full access