Function |
Does what |
os.access(path, mode) |
Uses the real uid/gid to test for access to
path. |
os.chdir(path) |
Changes the current working directory to
path. |
os.chflags(path, flags) |
Sets the flags of path to the numeric
flags. |
os.chmod(path, mode) |
Changes the mode of path to the numeric
mode. |
os.chown(path, uid, gid) |
Changes the owner and group id of path to
the numeric uid and gid. |
os.chroot(path) |
Changes the root directory of the current
process to path. |
os.close(fd) |
Closes file descriptor fd. |
os.closerange(fd_low, fd_high) |
Closes all file descriptors from fd_low
(inclusive) to fd_high (exclusive), ignoring errors. |
os.dup(fd) |
Returns a duplicate of file descriptor fd. |
os.dup2(fd, fd2) |
Duplicates file descriptor fd to fd2,
closing fd2 first if necessary. |
os.fchdir(fd) |
Changes the current working directory to the
directory represented by the file descriptor fd. |
os.fchmod(fd, mode) |
Changes the mode of the file given by fd to
the numeric mode. |
os.fchown(fd, uid, gid) |
Changes the owner and group id of the file
given by fd to the numeric uid and gid. |
os.fdatasync(fd) |
Forces write of file with filedescriptor fd
to disk. |
os.fdopen(fd[, mode[, bufsize]]) |
Returns an open file object connected to the
file descriptor fd. |
os.fpathconf(fd, name) |
Returns system configuration information
relevant to an open file. Name specifies the configuration
value to retrieve. |
os.fstat(fd) |
Returns status for file descriptor fd, like
stat(). |
os.fstatvfs(fd) |
Returns information about the filesystem
containing the file associated with file descriptor fd,
like statvfs(). |
os.fsync(fd) |
Forces write of file with filedescriptor fd
to disk. |
os.ftruncate(fd, length) |
Truncates the file corresponding to file
descriptor fd, so that it is at most length bytes in size. |
os.getcwd() |
Returns a string representing the current
working directory. |
os.getcwdu() |
Returns a Unicode object representing the
current working directory. |
os.isatty(fd) |
Returns True if the file descriptor fd is
open and connected to a TTY(-like) device, else False. |
os.lchflags(path, flags) |
Sets the flags of path to the numeric flags,
like chflags(), but do not follow symbolic links. |
os.lchmod(path, mode) |
Changes the mode of path to the numeric mode. |
os.lchown(path, uid, gid) |
Changes the owner and group id of path to
the numeric uid and gid. This function will not follow
symbolic links. |
os.link(src, dst) |
Creates a hard link pointing to src named dst. |
os.listdir(path) |
Returns a list containing the names of the
entries in the directory given by path. |
os.lseek(fd, pos, how) |
Sets the current position of file descriptor
fd to position pos, modified by how. |
os.lstat(path) |
Like stat(), but do not follow symbolic
links. |
os.major(device) |
Extracts the device major number from a raw
device number. |
os.makedev(major, minor) |
Composes a raw device number from the major
and minor device numbers. |
os.makedirs(path[, mode]) |
Recursive directory creation. |
os.minor(device) |
Extracts the device minor number from a
raw device number. |
os.mkdir(path[, mode]) |
Creates a directory named path with numeric
mode mode. |
os.mkfifo(path[, mode]) |
Creates a FIFO (a named pipe) named path
with numeric mode mode. The default mode is 0666 (octal). |
os.mknod(filename[, mode=0600, device]) |
Creates a filesystem node (file, device
special file or named pipe) named filename. |
os.open(file, flags[, mode]) |
Opens the file file and set various flags
according to flags and possibly its mode according to mode. |
os.openpty() |
Opens a new pseudo-terminal pair. Return a
pair of file descriptors (master, slave) for the PTY and
the TTY, respectively. |
os.pathconf(path, name) |
Returns system configuration information
relevant to a named file. |
os.pipe() |
Creates a pipe. Return a pair of file
descriptors (r, w) usable for reading and writing,
respectively. |
os.popen(command[, mode[, bufsize]]) |
Opens a pipe to or from command. |
os.read(fd, n) |
Reads at most n bytes from file descriptor
fd. Returns a string containing the bytes read. If the end
of the fd file has been reached, an empty string is
returned. |
os.readlink(path) |
Returns a string representing the path to
which the symbolic link points. |
os.remove(path) |
Removes the file path. |
os.removedirs(path) |
Removes directories recursively. |
os.rename(src, dst) |
Renames the file or directory src to dst. |
os.renames(old, new) |
Recursive directory or file renaming function. |
os.rmdir(path) |
Removes the directory path. |
os.stat(path) |
Performs a stat system call on the given path. |
os.stat_float_times([newvalue]) |
Determines whether stat_result represents
time stamps as float objects. |
os.statvfs(path) |
Performs a statvfs system call on the given path. |
os.symlink(src, dst) |
Creates a symbolic link pointing to src named dst. |
os.tcgetpgrp(fd) |
Returns the process group associated with the
terminal given by fd (an open file descriptor as returned
by open()). |
os.tcsetpgrp(fd, pg) |
Sets the process group associated with the
terminal given by fd (an open file descriptor as returned
by open()) to pg. |
os.tempnam([dir[, prefix]]) |
Returns a unique path name that is reasonable
for creating a temporary file. |
os.tmpfile() |
Returns a new file object opened in update
mode (w+b). |
os.tmpnam() |
Returns a unique path name that is
reasonable for creating a temporary file. |
os.ttyname(fd) |
Returns 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. |
os.unlink(path) |
Removes the file path. |
os.utime(path, times) |
Sets the access and modified times of the
file specified by path. |
os.walk(top[, topdown=True[, onerror=None[, followlinks=False]]]) |
Generates the file names in a directory
tree by walking the tree either top-down or bottom-up. |
os.write(fd, str) |
Writes the string str to file descriptor fd.
Returns the number of bytes written. |