Lines Matching +refs:is +refs:effective +refs:target
18 * The design of all built-in operating system dependent modules of Python is
19 such that as long as the same functionality is available, it uses the same
25 through the :mod:`os` module, but using them is of course a threat to
28 * An "Availability: Unix" note means that this function is commonly found on
76 ``environ['HOME']`` is the pathname of your home directory (on some platforms),
77 and is equivalent to ``getenv("HOME")`` in C.
79 This mapping is captured the first time the :mod:`os` module is imported,
86 be called automatically when the mapping is modified.
99 If :func:`putenv` is not provided, a modified copy of this mapping may be
105 automatically when an item is deleted from ``os.environ``, and when
106 one of the :meth:`pop` or :meth:`clear` methods is called.
130 Return the effective group id of the current process. This corresponds to the
138 .. index:: single: user; effective id
140 Return the current process's effective user id.
164 deployment target of :const:`10.5` or earlier, :func:`getgroups` returns
165 the list of effective group ids associated with the current user process;
166 this list is limited to a system-defined number of entries, typically 16,
168 If built with a deployment target greater than :const:`10.5`,
170 associated with the effective user id of the process; the group access
171 list may change over the lifetime of the process, it is not affected by
172 calls to :func:`setgroups`, and its length is not limited to 16. The
173 deployment target value, :const:`MACOSX_DEPLOYMENT_TARGET`, can be
180 the groups of which the specified username is a member, plus the specified
191 process. For most purposes, it is more useful to use the environment
192 variable :envvar:`LOGNAME` to find out who the user is, or
201 Return the process group id of the process with process id *pid*. If *pid* is 0,
202 the process group id of the current process is returned.
239 real, effective, and saved user ids.
249 real, effective, and saved group ids.
288 When :func:`putenv` is supported, assignments to items in ``os.environ`` are
290 calls to :func:`putenv` don't update ``os.environ``, so it is actually
296 Set the current process's effective group id.
303 Set the current process's effective user id.
319 identifying a group. This operation is typically available only to the superuser.
326 system-defined maximum number of effective group ids, typically 16.
333 which version is implemented (if any). See the Unix manual for the semantics.
349 Set the current process's real and effective group ids.
356 Set the current process's real, effective, and saved group ids.
365 Set the current process's real, effective, and saved user ids.
374 Set the current process's real and effective user ids.
409 error number, :exc:`ValueError` is raised.
430 leading component; a better way to get the hostname is
445 When :func:`unsetenv` is supported, deletion of items in ``os.environ`` is
447 calls to :func:`unsetenv` don't update ``os.environ``, so it is actually
474 ``'r'``, ``'w'``, or ``'a'``, otherwise a :exc:`ValueError` is raised.
477 On Unix, when the *mode* argument starts with ``'a'``, the *O_APPEND* flag is
484 Open a pipe to or from *command*. The return value is an open file object
486 is ``'r'`` (default) or ``'w'``. The *bufsize* argument has the same meaning as
488 status of the command (encoded in the format specified for :func:`wait`) is
490 except that when the exit status is zero (termination without errors), ``None``
491 is returned.
496 This function is obsolete. Use the :mod:`subprocess` module. Check
521 For each of the :func:`popen\*` variants, if *bufsize* is specified, it
523 string ``'b'`` or ``'t'``; on Windows this is needed to determine whether the
525 *mode* is ``'t'``.
529 (as with :func:`os.spawnv`). If *cmd* is a string it will be passed to the shell
534 retrieve the return codes is to use the :mod:`subprocess` module; these are only
547 This function is obsolete. Use the :mod:`subprocess` module. Check
561 This function is obsolete. Use the :mod:`subprocess` module. Check
575 This function is obsolete. Use the :mod:`subprocess` module. Check
583 point of view of the child process, so *child_stdin* is the child's standard
586 This functionality is also available in the :mod:`popen2` module using functions
599 by the current process. For example, standard input is usually file descriptor
600 0, standard output is 1, and standard error is 2. Further files opened by a
602 is slightly deceptive; on Unix platforms, sockets and pipes are also referenced
618 This function is intended for low-level I/O and must be applied to a file
682 This function is not available on MacOS.
688 specifies the configuration value to retrieve; it may be a string which is the
693 included in that mapping, passing an integer for *name* is also accepted.
695 If *name* is a string and is not known, :exc:`ValueError` is raised. If a
696 specific value for *name* is not supported by the host system, even if it is
697 included in ``pathconf_names``, an :exc:`OSError` is raised with
732 Truncate the file corresponding to file descriptor *fd*, so that it is at most
740 Return ``True`` if the file descriptor *fd* is open and connected to a
770 mode according to *mode*. The default *mode* is ``0777`` (octal), and the
771 current umask value is first masked out. Return the file descriptor for the
777 :const:`O_BINARY` is needed to open files in binary mode.
783 This function is intended for low-level I/O. For normal usage, use the
812 empty string is returned.
818 This function is intended for low-level I/O and must be applied to a file
844 file descriptor *fd*. If *fd* is not associated with a terminal device, an
845 exception is raised.
859 This function is intended for low-level I/O and must be applied to a file
930 will use the effective uid/gid, therefore this routine can be used in a
934 :const:`X_OK` to test permissions. Return :const:`True` if access is allowed,
942 Using :func:`access` to check if a user is authorized to e.g. open a file
953 is better written as::
1121 Change the mode of *path* to the numeric *mode*. If path is a symlink, this
1122 affects the symlink rather than the target. See the docs for :func:`chmod`
1150 *path*. The list is in arbitrary order. It does not include the special
1157 On Windows NT/2k/XP and Unix, if *path* is a Unicode object, the result will be
1166 platforms that do not support symbolic links, this is an alias for
1173 *mode* is ``0666`` (octal). The current umask value is first masked out from
1194 :func:`os.makedev`), otherwise it is ignored.
1224 Create a directory named *path* with numeric mode *mode*. The default *mode* is
1226 :exc:`OSError` is raised.
1230 On some systems, *mode* is ignored. Where it is used, the current umask
1231 value is first masked out. If bits other than the last 9 (i.e. the last 3
1232 digits of the octal representation of the *mode*) are set, their meaning is
1236 It is also possible to create temporary directories; see the
1251 created. The default *mode* is ``0777`` (octal).
1253 The *mode* parameter is passed to :func:`mkdir`; see :ref:`the mkdir()
1254 description <mkdir_modebits>` for how it is interpreted.
1270 specifies the configuration value to retrieve; it may be a string which is the
1275 included in that mapping, passing an integer for *name* is also accepted.
1277 If *name* is a string and is not known, :exc:`ValueError` is raised. If a
1278 specific value for *name* is not supported by the host system, even if it is
1279 included in ``pathconf_names``, an :exc:`OSError` is raised with
1296 result may be either an absolute or relative pathname; if it is relative, it may
1301 If the *path* is a Unicode object the result will also be a Unicode object.
1308 Remove (delete) the file *path*. If *path* is a directory, :exc:`OSError` is
1309 raised; see :func:`rmdir` below to remove a directory. This is identical to
1311 remove a file that is in use causes an exception to be raised; on Unix, the
1312 directory entry is removed but the storage allocated to the file is not made
1313 available until the original file is no longer in use.
1323 leaf directory is successfully removed, :func:`removedirs` tries to
1325 is raised (which is ignored, because it generally means that a parent directory
1326 is not empty). For example, ``os.removedirs('foo/bar/baz')`` will first remove
1336 Rename the file or directory *src* to *dst*. If *dst* is a directory,
1337 :exc:`OSError` will be raised. On Unix, if *dst* exists and is a file, it will
1340 the renaming will be an atomic operation (this is a POSIX requirement). On
1341 Windows, if *dst* already exists, :exc:`OSError` will be raised even if it is a
1351 creation of any intermediate directories needed to make the new pathname good is
1365 Remove (delete) the directory *path*. Only works when the directory is
1366 empty, otherwise, :exc:`OSError` is raised. In order to remove whole
1377 The return value is an object whose attributes correspond to the members
1426 For backward compatibility, the return value of :func:`~os.stat` is also accessible
1460 If *newvalue* is ``True``, future calls to :func:`~os.stat` return floats, if it is
1461 ``False``, future calls return ints. If *newvalue* is omitted, return the
1472 The resolution of the timestamps (that is the smallest possible fraction)
1476 It is recommended that this setting is only changed at program startup time in
1485 Perform a :c:func:`statvfs` system call on the given path. The return value is
1494 For backward compatibility, the return value is also accessible as a tuple whose
1516 Return a unique path name that is reasonable for creating a temporary file.
1518 directory *dir* or a common location for temporary files if *dir* is omitted or
1519 ``None``. If given and not ``None``, *prefix* is used to provide a short prefix
1522 cleanup is provided. On Unix, the environment variable :envvar:`TMPDIR`
1523 overrides *dir*, while on Windows :envvar:`TMP` is used. The specific
1529 Use of :func:`tempnam` is vulnerable to symlink attacks; consider using
1537 Return a unique path name that is reasonable for creating a temporary file.
1541 automatic cleanup is provided.
1545 Use of :func:`tmpnam` is vulnerable to symlink attacks; consider using
1563 Remove (delete) the file *path*. This is the same function as
1564 :func:`remove`; the :func:`unlink` name is its traditional Unix
1573 is ``None``, then the file's access and modified times are set to the current
1574 time. (The effect is similar to running the Unix program :program:`touch` on
1576 ``(atime, mtime)`` which is used to set the access and modified times,
1600 *dirpath* is a string, the path to the directory. *dirnames* is a list of the
1602 *filenames* is a list of the names of the non-directory files in *dirpath*.
1607 If optional argument *topdown* is ``True`` or not specified, the triple for a
1608 directory is generated before the triples for any of its subdirectories
1609 (directories are generated top-down). If *topdown* is ``False``, the triple
1610 for a directory is generated after the triples for all of its subdirectories
1612 list of subdirectories is retrieved before the tuples for the directory and
1615 When *topdown* is ``True``, the caller can modify the *dirnames* list in-place
1620 :func:`walk` again. Modifying *dirnames* when *topdown* is ``False`` has
1622 in *dirnames* are generated before *dirpath* itself is generated.
1625 argument *onerror* is specified, it should be a function; it will be called with
1628 is available as the ``filename`` attribute of the exception object.
1662 In the next example, walking the tree bottom-up is essential: :func:`rmdir`
1663 doesn't allow deleting a directory before the directory is empty::
1667 # CAUTION: This is dangerous! For example, if top == '/', it
1687 program loaded into the process. In each case, the first of these arguments is
1689 have typed on a command line. For the C programmer, this is the ``argv[0]``
1698 behavior is to produce a core dump; on Windows, the process immediately returns
1716 do not return. On Unix, the new executable is loaded into the current process,
1720 The current process is replaced immediately. Open file objects and
1728 to work with if the number of parameters is fixed when the code is written; the
1730 functions. The "v" variants are good when the number of parameters is
1733 the name of the command being run, but this is not enforced.
1738 environment is being replaced (using one of the :func:`exec\*e <execl>` variants,
1739 discussed in the next paragraph), the new environment is used as the source of
1746 that these all end in "e"), the *env* parameter must be a mapping which is
1764 The standard way to exit is ``sys.exit(n)``. :func:`_exit` should
1773 Some of these may not be available on all Unix platforms, since there is some
1835 Exit code that means that a required service is unavailable.
1941 parent. If an error occurs :exc:`OSError` is raised.
1956 terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, the
1957 new child's process id in the parent, and *fd* is the file descriptor of the
1959 :mod:`pty` module. If an error occurs :exc:`OSError` is raised.
2034 spawning new processes and retrieving their results; using that module is
2038 If *mode* is :const:`P_NOWAIT`, this function returns the process id of the new
2039 process; if *mode* is :const:`P_WAIT`, returns the process's exit code if it
2040 exits normally, or ``-signal``, where *signal* is the signal that killed the
2046 to work with if the number of parameters is fixed when the code is written; the
2049 parameters is variable, with the arguments being passed in a list or tuple as
2056 environment is being replaced (using one of the :func:`spawn\*e <spawnl>` variants,
2057 discussed in the next paragraph), the new environment is used as the source of
2065 which is used to define the environment variables for the new process (they are
2093 functions. If either of these values is given, the :func:`spawn\*` functions
2105 functions. If this is given as *mode*, the :func:`spawn\*` functions will not
2107 of the process the run is successful, or ``-signal`` if a signal kills the
2120 is similar to :const:`P_NOWAIT`, but the new process is detached from the
2121 console of the calling process. If :const:`P_OVERLAY` is used, the current
2133 When *operation* is not specified or ``'open'``, this acts like double-clicking
2135 :program:`start` command from the interactive command shell: the file is opened
2136 with whatever application (if any) its extension is associated.
2138 When another *operation* is given, it must be a "command verb" that specifies
2143 :func:`startfile` returns as soon as the associated application is launched.
2144 There is no option to wait for the application to close, and no way to retrieve
2145 the application's exit status. The *path* parameter is relative to the current
2147 is not a slash (``'/'``); the underlying Win32 :c:func:`ShellExecute` function
2148 doesn't work if it is. Use the :func:`os.path.normpath` function to ensure that
2149 the path is properly encoded for Win32.
2161 Execute the command (a string) in a subshell. This is implemented by calling
2166 On Unix, the return value is the exit status of the process encoded in the
2169 the Python function is system-dependent.
2171 On Windows, the return value is that returned by the system shell after running
2173 :program:`command.com` systems (Windows 95, 98 and ME) this is always ``0``; on
2174 :program:`cmd.exe` systems (Windows NT, 2000 and XP) this is the exit status of
2179 processes and retrieving their results; using that module is preferable to using
2202 and exit status indication: a 16-bit number, whose low byte is the signal number
2203 that killed the process, and whose high byte is the exit status (if the signal
2204 number is zero); the high bit of the low byte is set if a core file was
2219 If *pid* is greater than ``0``, :func:`waitpid` requests status information for
2220 that specific process. If *pid* is ``0``, the request is for the status of any
2221 child in the process group of the current process. If *pid* is ``-1``, the
2222 request pertains to any child of the current process. If *pid* is less than
2223 ``-1``, status is requested for any process in the process group ``-pid`` (the
2226 An :exc:`OSError` is raised with the value of errno when the syscall
2234 id is known, not necessarily a child process. The :func:`spawn\* <spawnl>`
2240 Similar to :func:`waitpid`, except no process id argument is given and a
2242 resource usage information is returned. Refer to :mod:`resource`.\
2244 option argument is the same as that provided to :func:`waitpid` and
2255 process id, exit status indication, and resource usage information is returned.
2268 is available immediately. The function returns ``(0, 0)`` in this case.
2343 If ``WIFEXITED(status)`` is true, return the integer parameter to the
2344 :manpage:`exit(2)` system call. Otherwise, the return value is meaningless.
2372 configuration value to retrieve; it may be a string which is the name of a
2377 mapping, passing an integer for *name* is also accepted.
2379 If the configuration value specified by *name* isn't defined, ``None`` is
2382 If *name* is a string and is not known, :exc:`ValueError` is raised. If a
2383 specific value for *name* is not supported by the host system, even if it is
2384 included in ``confstr_names``, an :exc:`OSError` is raised with
2413 specified by *name* isn't defined, ``-1`` is returned. The comments regarding
2415 provides information on the known names is given by ``sysconf_names``.
2437 directory. This is ``'.'`` for Windows and POSIX. Also available via
2444 directory. This is ``'..'`` for Windows and POSIX. Also available via
2451 This is ``'/'`` for POSIX and ``'\\'`` for Windows. Note that knowing this
2452 is not sufficient to be able to parse or concatenate pathnames --- use
2453 :func:`os.path.split` and :func:`os.path.join` --- but it is occasionally
2460 components, or ``None`` if only one separator character exists. This is set to
2461 ``'/'`` on Windows systems where ``sep`` is a backslash. Also available via
2518 ``CryptGenRandom()``. If a randomness source is not found,