
100
|
Python Pocket Reference
pipe()
See the section “Process Control,” later in this book.
read(fd, n)
Reads at most n bytes from file descriptor fd and returns
those bytes as a string.
write(fd, str)
Writes all bytes in string str to file descriptor fd.
fpathconf(fd, infoname)
fstatvfs(fd)
ttyname(fd)
openpty()
Consult the Python Library Reference or Unix manpages
for details.
File Pathname Tools
The following functions process files by their pathnames
(
path is a string pathname of a file). See also the section “The
os.path Module,” later in this book.
chdir(path)
getcwd()
See the section “Environment Tools,” earlier in this
book.
chmod(path, mode)
Changes mode of file path to numeric mode.
chown(path, uid, gid)
Changes owner/group IDs of path to numeric uid/gid.
Table 18. Or-able flags for os.open
O_APPEND O_EXCL O_RDONLY O_TRUNC
O_BINARY O_NDELAY O_RDWR O_WRONLY
O_CREAT O_NOCTTY O_RSYNC
O_DSYNC O_NONBLOCK O_SYNC