Revision as of 11:57, 11 June 2007

Introduction

This chapter deals with file access; that is, opening files, passing files as arguments to procedures that work with them, and so on.

File access and manipulation in Erlang is done by means of IoDevices (terms representing files, such as Standard Input and Output, or disk files). It's required that IoDevice terms associated with physical files be closed when they're no longer in use. IoDevices can be opened using the normal file permissions from standard POSIX file systems (read, write, append, raw).

All I/O procedures take as an optional parameter an IoDevice, and if not specified they will use the standard input (or standard output) device.