Package org.python.modules.posix
Class PosixModule
java.lang.Object
org.python.modules.posix.PosixModule
- All Implemented Interfaces:
ClassDictInit
The posix/nt module, depending on the platform.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
static PyString
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
_exit()
static void
_exit
(int status) static PyObject
Helper function for the subprocess module, returns the potential shell commands for this OS.static boolean
static void
static void
static void
static void
classDictInit
(PyObject dict) static void
static void
closerange
(PyObject fd_lowObj, PyObject fd_highObj) static void
static PyObject
static PyObject
static PyObject
static void
static void
static PyObject
getcwd()
static PyObject
getcwdu()
static int
getegid()
static int
geteuid()
static int
getgid()
static PyObject
getlogin()
static String
static int
getpgrp()
static int
getpid()
static jnr.posix.POSIX
getPOSIX()
static int
getppid()
static int
getuid()
static boolean
static void
kill
(int pid, int sig) static void
static void
static void
static PyList
static long
static void
static void
static FileIO
static FileIO
static PyTuple
pipe()
static PyObject
static void
static PyObject
static PyString
static void
static void
static void
static void
setpgrp()
static void
setsid()
static PyObject
strerror
(int code) static void
static PyTuple
times()
static int
umask
(int mask) static PyTuple
uname()
Resembles CPython's uname with the addition that we also attempt a Windows-equivalent variant on win-systems.static void
static void
static PyObject
urandom
(int n) static void
static PyObject
wait$()
static PyObject
waitpid
(int pid, int options) static int
-
Field Details
-
__doc__
-
__doc___exit
-
__doc__access
-
__doc__chdir
-
__doc__chmod
-
__doc__chown
-
__doc__close
-
__doc__fdopen
-
__doc__fdatasync
-
__doc__fsync
-
__doc__ftruncate
-
__doc__getcwd
-
__doc__getcwdu
-
__doc__getegid
-
__doc__geteuid
-
__doc__getgid
-
__doc__getlogin
-
__doc__getppid
-
__doc__getuid
-
__doc__getpid
-
__doc__getpgrp
-
__doc__isatty
-
__doc__kill
-
__doc__lchmod
-
__doc__lchown
-
__doc__link
-
__doc__listdir
-
__doc__lseek
-
__doc__mkdir
-
__doc__open
-
__doc__pipe
-
__doc__popen
-
__doc__putenv
-
__doc__read
-
__doc__readlink
-
__doc__remove
-
__doc__rename
-
__doc__rmdir
-
__doc__setpgrp
-
__doc__setsid
-
__doc__strerror
-
__doc__symlink
-
__doc__times
-
__doc__umask
-
__doc__uname
-
__doc__unlink
-
__doc__utime
-
__doc__wait
-
__doc__waitpid
-
__doc__write
-
__doc__unsetenv
-
__doc__urandom
-
-
Constructor Details
-
PosixModule
public PosixModule()
-
-
Method Details
-
classDictInit
-
_exit
public static void _exit() -
_exit
public static void _exit(int status) -
access
-
chdir
-
chmod
-
chown
-
close
-
closerange
-
fdopen
-
fdopen
-
fdopen
-
fdatasync
-
fsync
-
ftruncate
-
getcwd
-
getcwdu
-
getegid
public static int getegid() -
geteuid
public static int geteuid() -
getgid
public static int getgid() -
getlogin
-
getppid
public static int getppid() -
getuid
public static int getuid() -
getpid
public static int getpid() -
getpgrp
public static int getpgrp() -
isatty
-
kill
public static void kill(int pid, int sig) -
lchmod
-
lchown
-
link
-
listdir
-
lseek
-
mkdir
-
mkdir
-
open
-
open
-
pipe
-
popen
-
putenv
-
read
-
readlink
-
remove
-
rename
-
rmdir
-
setpgrp
public static void setpgrp() -
setsid
public static void setsid() -
strerror
-
symlink
-
times
-
umask
public static int umask(int mask) -
uname
Resembles CPython's uname with the addition that we also attempt a Windows-equivalent variant on win-systems. Implementation overview:
Original/CPython (POSIX only):
(uname -s, uname -n, uname -r, uname -v, uname -m)
This version (non-Windows):
(property os.name, InetAddress.getLocalHost().getHostName(), property os.version, uname -v, uname -m)
Adjustments on OSX:
Normalize "Mac OS X" to "Darwin",
uname -r instead of property os.version
Fallbacks:
nodename/uname -n: exec uname -n
version/uname -v: ""
machine/uname -m: property os.arch
This version (Windows):
(reproduces platform.uname behavior on Windows)
("Windows", InetAddress.getLocalHost().getHostName(), property os.name: part after "Windows", cmd.exe /C ver: part after "Version", env PROCESSOR_ARCHITECTURE)
Fallback for nodename/uname -n on Windows:
- env USERDOMAIN
- exec hostname
For machine-entry on Windows this is a simplified description. It is actually mapped to typical uname -m values as follows (pseudo-code):
PROCESSOR_ARCHITECTURE = x86 and PROCESSOR_ARCHITEW6432 undefined: "x86"
else if PROCESSOR_ARCHITECTURE = x86: PROCESSOR_ARCHITEW6432 else: PROCESSOR_ARCHITECTURE
Potential flaws:
- could be a 32-bit machine, but actually not i686
- user might need to discriminate AMD64 from EM64T
In the rare case that your application is sensitive to one of these flaws you shouldn't be using our uname-hack for Windows, but directly look at PROCESSOR_ARCHITECTURE and friends.- Returns:
- PyTuple containing sysname, nodename, release, version, machine
-
unlink
-
utime
-
wait$
-
waitpid
-
write
-
unsetenv
-
urandom
-
_get_shell_commands
Helper function for the subprocess module, returns the potential shell commands for this OS.- Returns:
- a tuple of lists of command line arguments. E.g. (['/bin/sh', '-c'])
-
getPOSIX
public static jnr.posix.POSIX getPOSIX() -
getOSName
-