IO
Class IO is the basis for all input and output in Ruby. An I/O stream may be duplexed (that is, bidirectional) and so may use more than one native operating system stream. Many of the examples in this section use class File, which is the only standard subclass of IO. The two classes are closely associated.
As used in this section, portname may take any of the following forms:
-
A plain string represents a filename suitable for the underlying operating system.
-
A string starting with | indicates a subprocess. The remainder of the string following | is invoked as a process with appropriate input/output channels connected to it.
-
A string equal to |- will create another Ruby instance as a subprocess.
The IO class uses the Unix abstraction of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access