Provides access to low-level system operations.
Classes
_class stat_result(object)
Functions
_abort()
Abort the current process.
_access(path,mask)
Determine if a file can be accessed.
Use the values F_OK
, R_OK
, W_OK
, and X_OK
to construct mask
and check if the current process has sufficient access rights to perform the requested operations on the file at path
.
_chdir(newcwd)
Change the current working directory.
Attempts to change the working directory to newcwd
. Raises OSError on failure.
_close(fd)
Close an open file descriptor.
_dup(fd)
Duplicate a file descriptor.
Returns a new file descriptor pointing to the same file as fd
.
_dup2(oldfd,newfd)
_execl(path,[args...])
Replace the current process.
The exec*
family of functions replaces the calling process's image with a new one. execl
takes a path
to a binary and an arbitrary number of str arguments to pass to the new executable.
_execle(path,[args...],env)
_execlp(filename,[args...])
Replace the current process.
The exec*
family of functions replaces the calling process's image with a new one. execlp
takes a filename
of a binary and an arbitrary number of str arguments to pass to the new executable. filename
will be searched for in $PATH
.
_execv(path,args)
_execvp(filename,args)
_exit()
Exit the current process.
_fork()
Fork the current process.
Returns the PID of the new child process in the original process and 0
in the child.
_get_terminal_size(fd=1)
Obtain the size of the terminal window. Obtain the size of the host terminal as a tuple of columns and lines.
_getcwd()
Get the name of the current working directory.
_getpid()
Obtain the system process identifier.
_isatty(fd)
Determine if a file descriptor is a terminal.
Returns a bool indicating whether the open file descriptor fd
refers to a terminal.
_kill(pid,signum)
Send a signal to a process.
Send the signal signum
to the process at pid
.
_lseek(fd,pos,how)
Seek an open file descriptor.
Seeks the open file descriptor fd
by pos
bytes as specified in how
. Use the values SEEK_SET
, SEEK_CUR
, and SEEK_END
for how
.
_mkdir(path,mode=0o777)
Create a directory.
Creates a directory at path
.
_open(path,flags,mode=0o777)
Open a file.
Opens the file at path
with the specified flags
and mode
. Returns a file descriptor.
_pipe()
Create a pipe.
Creates a pipe, returning a two-tuple of file descriptors for the read and write ends respectively.
_read(fd,n)
Read from an open file descriptor.
Reads at most n
bytes from the open file descriptor fd
.
_remove(path)
Delete a file.
Attempts to delete the file at path
.
_stat(path)
_strerror(errorno)
Convert an integer error code to a string.
Provides the string description for the error code specified by errorno
.
_symlink(src,dst)
Create a symbolic link.
Creates a symbolic link at src
pointing to dst
.
_system(cmd)
Call the system shell.
Runs cmd
using the system shell and returns the platform-dependent return value.
_tcgetpgrp(fd)
Get the terminal foreground process group.
Return the PID representing the foreground process group of the terminal specified by the file descriptor fd
.
_tcsetpgrp(fd,pgrp)
Set the terminal foreground process group.
Set the PID representing the foreground process group of the terminal specified by the file descriptor fd
to pgrp
.
_truncate(path,length)
Resize a file.
Attempts to resize the file at path
to length
bytes.
_ttyname(fd)
Get the path to a terminal device.
Returns a str representing the path to the terminal device provided by the file descriptor fd
.
_uname()
Returns a dict of attributes describing the current platform.
On POSIX platforms, the result should match the contents and layout of a standard uname()
call. On Windows, values are synthesized from available information.