jnios
Class posix

java.lang.Object
  |
  +--jnios.posix
All Implemented Interfaces:
org.python.core.InitModule

public class posix
extends java.lang.Object
implements org.python.core.InitModule

This module provides access to operating system functionality that is standardized by the C Standard and the POSIX standard (a thinly disguised Unix interface).

The module is based on the original posixmodule.c except that all mistakes and errors are my own. Original author unknown.

Do not import this module directly. Instead, import the module jnios, which provides a portable version of this interface. On Unix, the jnios module provides a superset of the posix interface. On non-Unix operating systems the posix module is not available, but a subset is always available through the jnios interface. Once jnios is imported, there is no performance penalty in using it instead of posix. In addition, jnios provides some additional functionality, such as automatically calling putenv() when an entry in jnios.environ is changed.

The descriptions below are very terse; refer to the corresponding Unix manual (or POSIX documentation) entry for more information. Arguments called path refer to a pathname given as a string.

Errors are reported as exceptions; the usual exceptions are given for type errors, while errors reported by the system calls raise error (a synonym for the standard exception OSError), described below.

Module posix defines the following data items:

environ
A dictionary or dictionary look-alike representing the string environment at the time the interpreter was started. For example, posix.environ['HOME'] is the pathname of your home directory, equivalent to getenv("HOME") in C.

Modifying this dictionary does not affect the string environment passed on by execv(), popen() or system(); if you need to change the environment, pass environ to execve() or add variable assignments and export statements to the command string for system() or popen().

However: If you are using this module via the os module (as you should - see the introduction above), environ is a a mapping object that behaves almost like a dictionary but invokes putenv() automatically whenever an item is changed.

error
This exception is raised when a POSIX function returns a POSIX-related error (e.g., not for illegal argument types). The accompanying value is a pair containing the numeric error code from errno and the corresponding string, as would be printed by the C function perror(). See the module errno, which contains names for the error codes defined by the underlying operating system.

When exceptions are classes, this exception carries two attributes, errno and strerror. The first holds the value of the C errno variable, and the latter holds the corresponding error message from strerror(). For exceptions that involve a file system path (e.g. chdir or unlink), the exception instance will contain a third attribute filename which is the file name passed to the function.

When exceptions are strings, the string for the exception is 'OSError'.

It defines the following functions and constants:

chdir (path)
Change the current working directory to path.

chmod (path, mode)
Change the mode of path to the numeric mode.

chown (path, uid, gid)
Change the owner and group id of path to the numeric uid and gid. (Not on MS-DOS.)

close (fd)
Close file descriptor fd.

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.

dup (fd)
Return a duplicate of file descriptor fd.

dup2 (fd, fd2)
Duplicate file descriptor fd to fd2, closing the latter first if necessary.

execv (path, args)
Execute the executable path with argument list args, replacing the current process (i.e., the Python interpreter). The argument list may be a tuple or list of strings. (Not on MS-DOS.)

execve (path, args, env)
Execute the executable path with argument list args, and environment env, replacing the current process (i.e., the Python interpreter). The argument list may be a tuple or list of strings. The environment must be a dictionary mapping strings to strings. (Not on MS-DOS.)

_exit (n)
Exit to the system with status n, without calling cleanup handlers, flushing stdio buffers, etc. (Not on MS-DOS.)

Note: the standard way to exit is sys.exit(n). _exit() should normally only be used in the child process after a fork().

fork ()
Fork a child process. Return 0 in the child, the child's process id in the parent. (Not on MS-DOS.)

fstat (fd)
Return status for file descriptor fd, like stat().

ftruncate (fd, length)
Truncate the file corresponding to file descriptor fd, so that it is at most length bytes in size.

getcwd ()
Return a string representing the current working directory.

getegid ()
Return the current process' effective group id. (Not on MS-DOS.)

geteuid ()
Return the current process' effective user id. (Not on MS-DOS.)

getgid ()
Return the current process' group id. (Not on MS-DOS.)

getpgrp ()
Return the current process group id. (Not on MS-DOS.)

getpid ()
Return the current process id. (Not on MS-DOS.)

getppid ()
Return the parent's process id. (Not on MS-DOS.)

getuid ()
Return the current process' user id. (Not on MS-DOS.)

kill (pid, sig)
Kill the process pid with signal sig. (Not on MS-DOS.)

link (src, dst)
Create a hard link pointing to src named dst. (Not on MS-DOS.)

listdir (path)
Return a list containing the names of the entries in the directory. The list is in arbitrary order. It does not include the special entries '.' and '..' even if they are present in the directory.

lseek (fd, pos, how)
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.

lstat (path)
Like stat(), but do not follow symbolic links. (On systems without symbolic links, this is identical to stat().)

mkfifo (path[, mode])
Create a FIFO (a POSIX named pipe) named path with numeric mode mode. The default mode is 0666 (octal). The current umask value is first masked out from the mode. (Not on MS-DOS.)

FIFOs are pipes that can be accessed like regular files. FIFOs exist until they are deleted (for example with os.unlink()). Generally, FIFOs are used as rendezvous between ``client'' and ``server'' type processes: the server opens the FIFO for reading, and the client opens it for writing. Note that mkfifo() doesn't open the FIFO -- it just creates the rendezvous point.

mkdir (path[, mode])
Create a directory named path with numeric mode mode. The default mode is 0777 (octal). On some systems, mode is ignored. Where it is used, the current umask value is first masked out.

nice (increment)
Add increment to the process' ``niceness''. Return the new niceness. (Not on MS-DOS.)

open (file, flags[, mode])
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.

For a description of the flag and mode values, see the Unix or 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).

pipe ()
Create a pipe. Return a pair of file descriptors (r, w) usable for reading and writing, respectively. (Not on MS-DOS.)

plock (op)
Lock program segments into memory. The value of op (defined in <sys/lock.h>) determines which segments are locked. (Not on MS-DOS.)

popen (command[, mode[, bufsize]])
Open a pipe to or from command. The return value is an open file object connected to the pipe, which can be read or written depending on whether mode is 'r' (default) or 'w'. The bufsize argument has the same meaning as the corresponding argument to the built-in open() function. The exit status of the command (encoded in the format specified for wait()) is available as the return value of the close() method of the file object, except that when the exit status is zero (termination without errors), None is returned. (Not on MS-DOS.)

putenv (varname, value)
Set the environment variable named varname to the string value. Such changes to the environment affect subprocesses started with os.system(), os.popen() or os.fork() and os.execv(). (Not on all systems.)

When putenv() is supported, assignments to items in os.environ are automatically translated into corresponding calls to putenv(); however, calls to putenv() don't update os.environ, so it is actually preferable to assign to items of os.environ.

strerror (code)
Return the error message corresponding to the error code in code.

read (fd, n)
Read at most n bytes from file descriptor fd. Return a string containing the bytes read.

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.

readlink (path)
Return a string representing the path to which the symbolic link points. (On systems without symbolic links, this always raises error.)

remove (path)
Remove the file path. See rmdir() below to remove a directory. This is identical to the unlink() function documented below.

rename (src, dst)
Rename the file or directory src to dst.

rmdir (path)
Remove the directory path.

setgid (gid)
Set the current process' group id. (Not on MS-DOS.)

setpgrp ()
Calls the system call setpgrp() or setpgrp(0, 0) depending on which version is implemented (if any). See the Unix manual for the semantics. (Not on MS-DOS.)

setpgid (pid, pgrp)
Calls the system call setpgid(). See the Unix manual for the semantics. (Not on MS-DOS.)

setsid ()
Calls the system call setsid(). See the Unix manual for the semantics. (Not on MS-DOS.)

setuid (uid)
Set the current process' user id. (Not on MS-DOS.)

stat (path)
Perform a stat() system call on the given path. The return value is a tuple of at least 10 integers giving the most important (and portable) members of the stat structure, in the order st_mode, st_ino, st_dev, st_nlink, st_uid, st_gid, st_size, st_atime, st_mtime, st_ctime. More items may be added at the end by some implementations. (On MS-DOS, some items are filled with dummy values.)

Note: The standard module stat defines functions and constants that are useful for extracting information from a stat structure.

symlink (src, dst)
Create a symbolic link pointing to src named dst. (On systems without symbolic links, this always raises error.)

system (command)
Execute the command (a string) in a subshell. This is implemented by calling the Standard C function system(), and has the same limitations. Changes to posix.environ, sys.stdin etc. are not reflected in the environment of the executed command. The return value is the exit status of the process encoded in the format specified for wait().

tcgetpgrp (fd)
Return the process group associated with the terminal given by fd (an open file descriptor as returned by open()). (Not on MS-DOS.)

tcsetpgrp (fd, pg)
Set the process group associated with the terminal given by fd (an open file descriptor as returned by open()) to pg. (Not on MS-DOS.)

times ()
Return a 5-tuple of floating point numbers indicating accumulated (CPU or other) times, in seconds. The items are: user time, system time, children's user time, children's system time, and elapsed real time since a fixed point in the past, in that order. See the Unix manual page times(2). (Not on MS-DOS.)

umask (mask)
Set the current numeric umask and returns the previous umask. (Not on MS-DOS.)

uname ()
Return a 5-tuple containing information identifying the current operating system. The tuple contains 5 strings: (sysname, nodename, release, version, machine). Some systems truncate the nodename to 8 characters or to the leading component; a better way to get the hostname is socket.gethostname()287 or even socket.gethostbyaddr(socket.gethostname())288. (Not on MS-DOS, nor on older Unix systems.)

unlink (path)
Remove the file path. This is the same function as remove; the unlink name is its traditional Unix name.

utime (path, (atime, mtime))
Set the access and modified time of the file to the given values. (The second argument is a tuple of two items.)

wait ()
Wait for completion of a child process, and return a tuple containing its pid and exit status indication: a 16-bit number, whose low byte is the signal number that killed the process, and whose high byte is the exit status (if the signal number is zero); the high bit of the low byte is set if a core file was produced. (Not on MS-DOS.)

waitpid (pid, options)
Wait for completion of a child process given by proces id, and return a tuple containing its pid and exit status indication (encoded as for wait()). The semantics of the call are affected by the value of the integer options, which should be 0 for normal operation. (If the system does not support waitpid(), this always raises error. Not on MS-DOS.)

write (fd, str)
Write the string str to file descriptor fd. Return the number of bytes actually written.

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.

WNOHANG
The option for waitpid() to avoid hanging if no child process status is available immediately.

O_RDONLY
O_WRONLY
O_RDWR
O_NDELAY
O_NONBLOCK
O_APPEND
O_DSYNC
O_RSYNC
O_SYNC
O_NOCTTY
O_CREAT
O_EXCL
O_TRUNC
Options for the flag argument to the open() function. These can be bit-wise OR'd together.

Version:
$Id: posix.java,v 1.1 1999/10/12 17:15:38 fb Exp $
Author:
Finn Bock, bckfnn@pipmail.dknet.dk

Field Summary
static org.python.core.PyObject error
           
 
Constructor Summary
posix()
           
 
Method Summary
static void _exit(int status)
          _exit(status).
static int access(java.lang.String path, int mode)
          access(path, mode) -> 1 if granted, 0 otherwise.
static void chdir(java.lang.String dir)
          chdir(path) -> None.
static void chmod(java.lang.String dir, int mode)
          chmod(path, mode) -> None.
static void chown(java.lang.String dir, int uid, int gid)
          chown(path, uid, gid) -> None.
static void close(int fd)
          close(fd) -> None.
static int dup(int fd)
          dup(fd) -> fd2- Return a duplicate of a file descriptor.
static void dup2(int fd, int fd2)
          dup2(fd, fd2) -> None.
static void execv(java.lang.String path, java.lang.String[] args)
          execv(path, args).
static void execve(java.lang.String path, java.lang.String[] args, org.python.core.PyObject env)
          execve(path, args, env).
static void fdatasync(int fd)
          fdatasync(fildes) -> None. force write of file with filedescriptor to disk. does not force update of metadata.
static PosixFile fdopen(int fd)
          fdopen(fd, [, mode='r' [, bufsize]]) -> file_object.
static PosixFile fdopen(int fd, java.lang.String mode)
          fdopen(fd, [, mode='r' [, bufsize]]) -> file_object.
static PosixFile fdopen(int fd, java.lang.String mode, int bufsize)
          fdopen(fd, [, mode='r' [, bufsize]]) -> file_object.
static int fork()
          fork() -> pid.
static org.python.core.PyTuple fstat(int fd)
          fstat(fd) -> (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime).
static org.python.core.PyTuple fstatvfs(int fd)
          fstatvfs(fd) -> (bsize, frsize, blocks, bfree, bavail, files, ffree, favail, flag, namemax).
static org.python.core.PyTuple fstatvfs(java.lang.String path)
          statvfs(path) -> (bsize, frsize, blocks, bfree, bavail, files, ffree, favail, flag, namemax).
static void fsync(int fd)
          fsync(fildes) -> None. force write of file with filedescriptor to disk.
static void ftruncate(int fd, int len)
          ftruncate(fd, length) -> None.
static java.lang.String getcwd()
          getcwd() -> path.
static int getegid()
          getegid() -> egid.
static int geteuid()
          geteuid() -> euid.
static int getgid()
          getgid() -> gid.
static java.lang.String getName()
           
static int getpgrp()
          getpgrp() -> pgrp.
static int getpid()
          getpid() -> pid.
static int getppid()
          getppid() -> ppid.
static int getuid()
          getuid() -> uid.
 void initModule(org.python.core.PyObject dict)
           
static void kill(int pid, int sig)
          kill(pid, sig) -> None.
static void link(java.lang.String src, java.lang.String dst)
          link(src, dst) -> None.
static org.python.core.PyList listdir(java.lang.String path)
          listdir(path) -> list_of_strings.
static long lseek(int fd, long pos, int how)
          lseek(fd, pos, how) -> newpos.
static org.python.core.PyTuple lstat(java.lang.String file)
          lstat(path) -> (mode,ino,dev,nlink,uid,gid,size,atime,mtime,ctime).
static void main(java.lang.String[] args)
           
static void mkdir(java.lang.String path)
          mkdir(path [, mode=0777]) -> None.
static void mkdir(java.lang.String dir, int mode)
          mkdir(path, mode=0777) -> None.
static void mkfifo(java.lang.String file, int mode)
          mkfifo(file, [, mode=0666]) -> None.
static int nice(int incr)
          nice(inc) -> new_priority.
static int open(java.lang.String file, int flag)
          open(filename, flag) -> fd.
static int open(java.lang.String file, int flag, int mode)
          open(filename, flag mode=0777) -> fd.
static org.python.core.PyTuple pipe()
          pipe() -> (read_end, write_end).
static void plock(int op)
          plock(op) -> None.
static PosixFile popen(java.lang.String name)
          popen(command [, mode='r' [, bufsize]]) -> pipe.
static PosixFile popen(java.lang.String name, java.lang.String mode)
          popen(command [, mode='r' [, bufsize]]) -> pipe.
static PosixFile popen(java.lang.String name, java.lang.String mode, int bufsize)
          popen(command [, mode='r' [, bufsize]]) -> pipe.
static void putenv(java.lang.String key, java.lang.String value)
          putenv(key, value) -> None.
static java.lang.String read(int fd, int size)
          read(fd, buffersize) -> string.
static java.lang.String readlink(java.lang.String file)
          readlink(path) -> path.
static void remove(java.lang.String file)
          remove(path) -> None.
static void rename(java.lang.String src, java.lang.String dst)
          rename(old, new) -> None.
static void rmdir(java.lang.String dir)
          rmdir(path) -> None.
static void setgid(int gid)
          setgid(gid) -> None.
static void setpgid()
          setpgid(pid, pgrp) -> None.
static void setpgrp()
          setpgrp() -> None.
static void setsid()
          setsid() -> None.
static void setuid(int uid)
          setuid(uid) -> None.
static int spawnv(int mode, java.lang.String path, java.lang.String[] args)
          spawnv(mode, path, args).
static int spawnve(int mode, java.lang.String path, java.lang.String[] args, org.python.core.PyObject env)
          spawnve(mode, path, args, env).
static org.python.core.PyTuple stat(java.lang.String file)
          stat(path) -> (mode,ino,dev,nlink,uid,gid,size,atime,mtime,ctime).
static java.lang.String strerror(int code)
          strerror(code) -> string.
static void symlink(java.lang.String src, java.lang.String dst)
          symlink(src, dst) -> None.
static int system(java.lang.String cmd)
          system(command) -> exit_status.
static int tcgetpgrp(int fd)
          tcgetpgrp(fd) -> pgid.
static void tcsetpgrp(int fd, int pgid)
          tcsetpgrp(fd, pgid) -> None.
static org.python.core.PyTuple times()
          times() -> (utime, stime, cutime, cstime, elapsed_time).
static java.lang.String ttyname(int fd)
          ttyname(fd) -> String.
static int umask(int mask)
          umask(new_mask) -> old_mask.
static org.python.core.PyTuple uname()
          uname() -> (sysname, nodename, release, version, machine).
static void unlink(java.lang.String file)
          unlink(path) -> None.
static void utime(java.lang.String file, int[] times)
          utime(path, (atime, utime)) -> None.
static org.python.core.PyTuple wait(int pid, int options)
          wait() -> (pid, status).
static org.python.core.PyTuple waitpid(int pid, int options)
          waitpid(pid, options) -> (pid, status).
static int WEXITSTATUS(int status)
          WEXITSTATUS(status) -> integer.
static int WIFEXITED(int status)
          WIFEXITED(status) -> Boolean.
static int WIFSIGNALED(int status)
          WIFSIGNALED(status) -> Boolean.
static int WIFSTOPPED(int status)
          WIFSTOPPED(status) -> Boolean Return true if the process returning 'status' was stopped.
static int write(int fd, byte[] buf)
          write(fd, string) -> byteswritten.
static int WSTOPSIG(int status)
          WSTOPSIG(status) -> integer.
static int WTERMSIG(int status)
          WTERMSIG(status) -> integer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

error

public static org.python.core.PyObject error
Constructor Detail

posix

public posix()
Method Detail

initModule

public void initModule(org.python.core.PyObject dict)
Specified by:
initModule in interface org.python.core.InitModule

chdir

public static final void chdir(java.lang.String dir)
chdir(path) -> None. Change the current working directory to the specified path.

chmod

public static final void chmod(java.lang.String dir,
                               int mode)
chmod(path, mode) -> None. Change the access permissions of a file.

fsync

public static final void fsync(int fd)
fsync(fildes) -> None. force write of file with filedescriptor to disk.

fdatasync

public static final void fdatasync(int fd)
fdatasync(fildes) -> None. force write of file with filedescriptor to disk. does not force update of metadata.

chown

public static final void chown(java.lang.String dir,
                               int uid,
                               int gid)
chown(path, uid, gid) -> None. Change the owner and group id of path to the numeric uid and gid.

getcwd

public static final java.lang.String getcwd()
getcwd() -> path. Return a string representing the current working directory.

link

public static final void link(java.lang.String src,
                              java.lang.String dst)
link(src, dst) -> None. Create a hard link to a file.

listdir

public static final org.python.core.PyList listdir(java.lang.String path)
listdir(path) -> list_of_strings. Return a list containing the names of the entries in the directory.

path: path of directory to list.

The list is in arbitrary order. It does not include the special entries '.' and '..' even if they are present in the directory.


lstat

public static final org.python.core.PyTuple lstat(java.lang.String file)
lstat(path) -> (mode,ino,dev,nlink,uid,gid,size,atime,mtime,ctime). Like stat(path), but do not follow symbolic links.

mkdir

public static final void mkdir(java.lang.String path)
mkdir(path [, mode=0777]) -> None. Create a directory.

mkdir

public static final void mkdir(java.lang.String dir,
                               int mode)
mkdir(path, mode=0777) -> None. Create a directory.

nice

public static final int nice(int incr)
nice(inc) -> new_priority. Decrease the priority of process and return new priority.

readlink

public static final java.lang.String readlink(java.lang.String file)
readlink(path) -> path. Return a string representing the path to which the symbolic link points.

rename

public static final void rename(java.lang.String src,
                                java.lang.String dst)
rename(old, new) -> None. Rename a file or directory.

rmdir

public static final void rmdir(java.lang.String dir)
rmdir(path) -> None. Remove a directory.

stat

public static final org.python.core.PyTuple stat(java.lang.String file)
stat(path) -> (mode,ino,dev,nlink,uid,gid,size,atime,mtime,ctime). Perform a stat system call on the given path.

symlink

public static final void symlink(java.lang.String src,
                                 java.lang.String dst)
symlink(src, dst) -> None. Create a symbolic link.

access

public static final int access(java.lang.String path,
                               int mode)
access(path, mode) -> 1 if granted, 0 otherwise. Test for access to a file.

ttyname

public static final java.lang.String ttyname(int fd)
ttyname(fd) -> String. Return the name of the terminal device connected to 'fd'.

system

public static final int system(java.lang.String cmd)
system(command) -> exit_status. Execute the command (a string) in a subshell.

umask

public static final int umask(int mask)
umask(new_mask) -> old_mask. Set the current numeric umask and return the previous umask.

uname

public static final org.python.core.PyTuple uname()
uname() -> (sysname, nodename, release, version, machine). Return a tuple identifying the current operating system.

unlink

public static final void unlink(java.lang.String file)
unlink(path) -> None. Remove a file (same as remove(path)).

remove

public static final void remove(java.lang.String file)
remove(path) -> None. Remove a file (same as unlink(path)).

utime

public static final void utime(java.lang.String file,
                               int[] times)
utime(path, (atime, utime)) -> None. Set the access and modified time of the file to the given values.

times

public static final org.python.core.PyTuple times()
times() -> (utime, stime, cutime, cstime, elapsed_time). Return a tuple of floating point numbers indicating process times.

_exit

public static final void _exit(int status)
_exit(status). Exit to the system with specified status, without normal exit processing.

execv

public static final void execv(java.lang.String path,
                               java.lang.String[] args)
execv(path, args). Execute an executable path with arguments, replacing current process.

path: path of executable file
args: tuple or list of strings


execve

public static final void execve(java.lang.String path,
                                java.lang.String[] args,
                                org.python.core.PyObject env)
execve(path, args, env). Execute a path with arguments and environment, replacing current process.

path: path of executable file
args: tuple or list of arguments
env: dictonary of strings mapping to strings


spawnv

public static final int spawnv(int mode,
                               java.lang.String path,
                               java.lang.String[] args)
spawnv(mode, path, args). Execute an executable path with arguments, replacing current process.

mode: mode of process creation
path: path of executable file
args: tuple or list of strings


spawnve

public static final int spawnve(int mode,
                                java.lang.String path,
                                java.lang.String[] args,
                                org.python.core.PyObject env)
spawnve(mode, path, args, env). Execute a path with arguments and environment, replacing current process.

mode: mode of process creation
path: path of executable file
args: tuple or list of arguments
env: dictonary of strings mapping to strings


fork

public static final int fork()
fork() -> pid. Fork a child process.

Return 0 to child process and PID of child to parent process.


getegid

public static final int getegid()
getegid() -> egid. Return the current process's effective group id.

geteuid

public static final int geteuid()
geteuid() -> euid. Return the current process's effective user id.

getgid

public static final int getgid()
getgid() -> gid. Return the current process's group id.

getpid

public static final int getpid()
getpid() -> pid. Return the current process id

getpgrp

public static final int getpgrp()
getpgrp() -> pgrp. Return the current process group id.

getppid

public static final int getppid()
getppid() -> ppid. Return the parent's process id.

getuid

public static final int getuid()
getuid() -> uid. Return the current process's user id.

kill

public static final void kill(int pid,
                              int sig)
kill(pid, sig) -> None. Kill a process with a signal.

plock

public static final void plock(int op)
plock(op) -> None. Lock program segments into memory.

popen

public static final PosixFile popen(java.lang.String name)
popen(command [, mode='r' [, bufsize]]) -> pipe. Open a pipe to/from a command returning a file object.

popen

public static final PosixFile popen(java.lang.String name,
                                    java.lang.String mode)
popen(command [, mode='r' [, bufsize]]) -> pipe. Open a pipe to/from a command returning a file object.

popen

public static final PosixFile popen(java.lang.String name,
                                    java.lang.String mode,
                                    int bufsize)
popen(command [, mode='r' [, bufsize]]) -> pipe. Open a pipe to/from a command returning a file object.

setuid

public static final void setuid(int uid)
setuid(uid) -> None. Set the current process's user id.

setgid

public static final void setgid(int gid)
setgid(gid) -> None. Set the current process's group id.

setpgrp

public static final void setpgrp()
setpgrp() -> None. Make this process a session leader.

wait

public static final org.python.core.PyTuple wait(int pid,
                                                 int options)
wait() -> (pid, status). Wait for completion of a child process.

waitpid

public static final org.python.core.PyTuple waitpid(int pid,
                                                    int options)
waitpid(pid, options) -> (pid, status). Wait for completion of a give child process.

setsid

public static final void setsid()
setsid() -> None. Call the system call setsid().

setpgid

public static final void setpgid()
setpgid(pid, pgrp) -> None. Call the system call setpgid().

tcgetpgrp

public static final int tcgetpgrp(int fd)
tcgetpgrp(fd) -> pgid. Return the process group associated with the terminal given by a fd.

tcsetpgrp

public static final void tcsetpgrp(int fd,
                                   int pgid)
tcsetpgrp(fd, pgid) -> None. Set the process group associated with the terminal given by a fd.

open

public static final int open(java.lang.String file,
                             int flag,
                             int mode)
open(filename, flag mode=0777) -> fd. Open a file (for low level IO).

open

public static final int open(java.lang.String file,
                             int flag)
open(filename, flag) -> fd. Open a file (for low level IO).

close

public static final void close(int fd)
close(fd) -> None. Close a file descriptor (for low level IO).

dup

public static final int dup(int fd)
dup(fd) -> fd2- Return a duplicate of a file descriptor.

dup2

public static final void dup2(int fd,
                              int fd2)
dup2(fd, fd2) -> None. Duplicate file descriptor.

lseek

public static final long lseek(int fd,
                               long pos,
                               int how)
lseek(fd, pos, how) -> newpos. Set the current position of a file descriptor.

read

public static final java.lang.String read(int fd,
                                          int size)
read(fd, buffersize) -> string. Read a file descriptor.

write

public static final int write(int fd,
                              byte[] buf)
write(fd, string) -> byteswritten. Write a string to a file descriptor.

fstat

public static final org.python.core.PyTuple fstat(int fd)
fstat(fd) -> (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime). Like stat(), but for an open file descriptor.

fdopen

public static final PosixFile fdopen(int fd)
fdopen(fd, [, mode='r' [, bufsize]]) -> file_object. Return an open file object connected to a file descriptor.";

fdopen

public static final PosixFile fdopen(int fd,
                                     java.lang.String mode)
fdopen(fd, [, mode='r' [, bufsize]]) -> file_object. Return an open file object connected to a file descriptor.";

fdopen

public static final PosixFile fdopen(int fd,
                                     java.lang.String mode,
                                     int bufsize)
fdopen(fd, [, mode='r' [, bufsize]]) -> file_object. Return an open file object connected to a file descriptor.";

pipe

public static final org.python.core.PyTuple pipe()
pipe() -> (read_end, write_end). Create a pipe.

mkfifo

public static final void mkfifo(java.lang.String file,
                                int mode)
mkfifo(file, [, mode=0666]) -> None. Create a FIFO (a POSIX named pipe).

ftruncate

public static final void ftruncate(int fd,
                                   int len)
ftruncate(fd, length) -> None. Truncate a file to a specified length.

putenv

public static final void putenv(java.lang.String key,
                                java.lang.String value)
putenv(key, value) -> None. Change or add an environment variable.

strerror

public static final java.lang.String strerror(int code)
strerror(code) -> string. Translate an error code to a message string.

WIFSTOPPED

public static final int WIFSTOPPED(int status)
WIFSTOPPED(status) -> Boolean Return true if the process returning 'status' was stopped.

WIFSIGNALED

public static final int WIFSIGNALED(int status)
WIFSIGNALED(status) -> Boolean. Return true if the process returning 'status' was terminated by a signal.

WIFEXITED

public static final int WIFEXITED(int status)
WIFEXITED(status) -> Boolean. Return true if the process returning 'status' exited using the exit().

WEXITSTATUS

public static final int WEXITSTATUS(int status)
WEXITSTATUS(status) -> integer. Return the process return code from 'status'.

WTERMSIG

public static final int WTERMSIG(int status)
WTERMSIG(status) -> integer. Return the signal that terminated the process that provided the 'status' value.

WSTOPSIG

public static final int WSTOPSIG(int status)
WSTOPSIG(status) -> integer. Return the signal that stopped the process that provided the 'status' value.

fstatvfs

public static final org.python.core.PyTuple fstatvfs(int fd)
fstatvfs(fd) -> (bsize, frsize, blocks, bfree, bavail, files, ffree, favail, flag, namemax). Perform an fstatvfs system call on the given fd.

fstatvfs

public static final org.python.core.PyTuple fstatvfs(java.lang.String path)
statvfs(path) -> (bsize, frsize, blocks, bfree, bavail, files, ffree, favail, flag, namemax). Perform a statvfs system call on the given path.

main

public static void main(java.lang.String[] args)

getName

public static final java.lang.String getName()