Close file descriptor fd.
Availability: Macintosh, Unix, Windows.
Note: this function is intended for low-level I/O and must be applied
to a file descriptor as returned by open() or
pipe(). To close a ``file object'' returned by the
built-in function open() or by popen() or
fdopen(), use its close() method.
Return system configuration information relevant to an open file.
name specifies the configuration value to retrieve; it may be a
string which is the name of a defined system value; these names are
specified in a number of standards (POSIX.1, Unix95, Unix98, and
others). Some platforms define additional names as well. The names
known to the host operating system are given in the
pathconf_names dictionary. For configuration variables not
included in that mapping, passing an integer for name is also
accepted.
Availability: Unix.
If name is a string and is not known, ValueError is
raised. If a specific value for name is not supported by the
host system, even if it is included in pathconf_names, an
OSError is raised with errno.EINVAL for the
error number.
Set the current position of file descriptor fd to position
pos, modified by how: 0 to set the position
relative to the beginning of the file; 1 to set it relative to
the current position; 2 to set it relative to the end of the
file.
Availability: Macintosh, Unix, Windows.
Open the file file and set various flags according to
flags and possibly its mode according to mode.
The default mode is 0777 (octal), and the current umask
value is first masked out. Return the file descriptor for the newly
opened file.
Availability: Macintosh, Unix, Windows.
For a description of the flag and mode values, see the C run-time
documentation; flag constants (like O_RDONLY and
O_WRONLY) are defined in this module too (see below).
Note: this function is intended for low-level I/O. For normal usage,
use the built-in function open(), which returns a ``file
object'' with read() and write() methods (and many
more).
Open a new pseudo-terminal pair. Return a pair of file descriptors
(master, slave) for the pty and the tty,
respectively. For a (slightly) more portable approach, use the
ptymodule.
Availability: Some flavors of Unix.
Read at most n bytes from file descriptor fd.
Return a string containing the bytes read.
Availability: Macintosh, Unix, Windows.
Note: this function is intended for low-level I/O and must be applied
to a file descriptor as returned by open() or
pipe(). To read a ``file object'' returned by the
built-in function open() or by popen() or
fdopen(), or sys.stdin, use its
read() or readline() methods.
Return a string which specifies the terminal device associated with
file-descriptor fd. If fd is not associated with a terminal
device, an exception is raised.
Availability: Unix.
Write the string str to file descriptor fd.
Return the number of bytes actually written.
Availability: Macintosh, Unix, Windows.
Note: this function is intended for low-level I/O and must be applied
to a file descriptor as returned by open() or
pipe(). To write a ``file object'' returned by the
built-in function open() or by popen() or
fdopen(), or sys.stdout or sys.stderr, use
its write() method.
The following data items are available for use in constructing the
flags parameter to the open() function.