Pelokalan
Python ID
id en
Masuk
Proyek
library__os.po Berkas proyek · python-docs-id-3.14 · Bahasa Indonesia
Modul PO Hanya lihat
Teks sumber — English
Terjemahan — Bahasa Indonesia
If the system call is interrupted and the signal handler does not raise an exception, the function now retries the system call instead of raising an :exc:`InterruptedError` exception (see :pep:`475` for the rationale).
Jika panggilan sistem terganggu dan penangan sinyal tidak menimbulkan pengecualian, fungsi sekarang mencoba ulang panggilan sistem alih-alih menimbulkan pengecualian :exc:`InterruptedError` (lihat :pep:`475` untuk penjelasannya).
If :const:`SPLICE_F_MOVE` is specified, the kernel is asked to move pages instead of copying, but pages may still be copied if the kernel cannot move the pages from the pipe.
**specifying a file descriptor:** Normally the *path* argument provided to functions in the :mod:`!os` module must be a string specifying a file path. However, some functions now alternatively accept an open file descriptor for their *path* argument. The function will then operate on the file referred to by the descriptor. For POSIX systems, Python will call the variant of the function prefixed with ``f`` (e.g. call ``fchdir`` instead of ``chdir``).
**paths relative to directory descriptors:** If *dir_fd* is not ``None``, it should be a file descriptor referring to a directory, and the path to operate on should be relative; path will then be relative to that directory. If the path is absolute, *dir_fd* is ignored. For POSIX systems, Python will call the variant of the function with an ``at`` suffix and possibly prefixed with ``f`` (e.g. call ``faccessat`` instead of ``access``).
If *effective_ids* is ``True``, :func:`access` will perform its access checks using the effective uid/gid instead of the real uid/gid. *effective_ids* may not be supported on your platform; you can check whether or not it is available using :data:`os.supports_effective_ids`. If it is unavailable, using it will raise a :exc:`NotImplementedError`.
Using :func:`scandir` instead of :func:`listdir` can significantly increase the performance of code that also needs file type or file attribute information, because :class:`os.DirEntry` objects expose this information if the operating system provides it when scanning a directory. All :class:`os.DirEntry` methods may perform a system call, but :func:`~os.DirEntry.is_dir` and :func:`~os.DirEntry.is_file` usually only require a system call for symbolic links; :func:`os.DirEntry.stat` always requires a system call on Unix but only requires one for symbolic links on Windows.
On Windows, passing ``follow_symlinks=False`` will disable following all name-surrogate reparse points, which includes symlinks and directory junctions. Other types of reparse points that do not resemble links or that the operating system is unable to follow will be opened directly. When following a chain of multiple links, this may result in the original link being returned instead of the non-link that prevented full traversal. To obtain stat results for the final path in this case, use the :func:`os.path.realpath` function to resolve the path name as far as possible and call :func:`lstat` on the result. This does not apply to dangling symlinks or junction points, which will raise the usual exceptions.
Added the *dir_fd* and *follow_symlinks* parameters, specifying a file descriptor instead of a path.
On Windows, all reparse points that can be resolved by the operating system are now followed, and passing ``follow_symlinks=False`` disables following all name surrogate reparse points. If the operating system reaches a reparse point that it is not able to follow, *stat* now returns the information for the original path as if ``follow_symlinks=False`` had been specified instead of raising an error.
If the final component of a path is an automount point, operate on the automount point instead of performing the automount. On Linux, :func:`os.stat`, :func:`os.fstat` and :func:`os.lstat` always behave this way.
This function now calls :func:`os.scandir` instead of :func:`os.listdir`, making it faster by reducing the number of calls to :func:`os.stat`.
For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` (note that these all end in "e"), the *env* parameter must be a mapping which is used to define the environment variables for the new process (these are used instead of the current process' environment); the functions :func:`execl`, :func:`execlp`, :func:`execv`, and :func:`execvp` all cause the new process to inherit the environment of the current process.
Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`.
For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` (note that these all end in "e"), the *env* parameter must be a mapping which is used to define the environment variables for the new process (they are used instead of the current process' environment); the functions :func:`spawnl`, :func:`spawnlp`, :func:`spawnv`, and :func:`spawnvp` all cause the new process to inherit the environment of the current process. Note that keys and values in the *env* dictionary must be strings; invalid keys or values will cause the function to fail, with a return value of ``127``.
On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` which is deprecated.
If this bit is set, then random bytes are drawn from the ``/dev/random`` pool instead of the ``/dev/urandom`` pool.