forked from AFPy/python-docs-fr
891 lines
25 KiB
Plaintext
891 lines
25 KiB
Plaintext
# Copyright (C) 2001-2018, Python Software Foundation
|
|
# For licence information, see README file.
|
|
#
|
|
msgid ""
|
|
msgstr ""
|
|
"Project-Id-Version: Python 3.6\n"
|
|
"Report-Msgid-Bugs-To: \n"
|
|
"POT-Creation-Date: 2018-06-28 15:29+0200\n"
|
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
|
|
"Language: fr\n"
|
|
"MIME-Version: 1.0\n"
|
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
"Content-Transfer-Encoding: 8bit\n"
|
|
|
|
#: ../Doc/library/pathlib.rst:3
|
|
msgid ":mod:`pathlib` --- Object-oriented filesystem paths"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:10
|
|
msgid "**Source code:** :source:`Lib/pathlib.py`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:16
|
|
msgid ""
|
|
"This module offers classes representing filesystem paths with semantics "
|
|
"appropriate for different operating systems. Path classes are divided "
|
|
"between :ref:`pure paths <pure-paths>`, which provide purely computational "
|
|
"operations without I/O, and :ref:`concrete paths <concrete-paths>`, which "
|
|
"inherit from pure paths but also provide I/O operations."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:25
|
|
msgid ""
|
|
"If you've never used this module before or just aren't sure which class is "
|
|
"right for your task, :class:`Path` is most likely what you need. It "
|
|
"instantiates a :ref:`concrete path <concrete-paths>` for the platform the "
|
|
"code is running on."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:29
|
|
msgid "Pure paths are useful in some special cases; for example:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:31
|
|
msgid ""
|
|
"If you want to manipulate Windows paths on a Unix machine (or vice versa). "
|
|
"You cannot instantiate a :class:`WindowsPath` when running on Unix, but you "
|
|
"can instantiate :class:`PureWindowsPath`."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:34
|
|
msgid ""
|
|
"You want to make sure that your code only manipulates paths without actually "
|
|
"accessing the OS. In this case, instantiating one of the pure classes may be "
|
|
"useful since those simply don't have any OS-accessing operations."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:39
|
|
msgid ":pep:`428`: The pathlib module -- object-oriented filesystem paths."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:42
|
|
msgid ""
|
|
"For low-level path manipulation on strings, you can also use the :mod:`os."
|
|
"path` module."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:47
|
|
msgid "Basic use"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:49
|
|
msgid "Importing the main class::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:53
|
|
msgid "Listing subdirectories::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:60
|
|
msgid "Listing Python source files in this directory tree::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:67
|
|
msgid "Navigating inside a directory tree::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:76
|
|
msgid "Querying path properties::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:83
|
|
msgid "Opening a file::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:93
|
|
msgid "Pure paths"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:95
|
|
msgid ""
|
|
"Pure path objects provide path-handling operations which don't actually "
|
|
"access a filesystem. There are three ways to access these classes, which we "
|
|
"also call *flavours*:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:101
|
|
msgid ""
|
|
"A generic class that represents the system's path flavour (instantiating it "
|
|
"creates either a :class:`PurePosixPath` or a :class:`PureWindowsPath`)::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:107
|
|
msgid ""
|
|
"Each element of *pathsegments* can be either a string representing a path "
|
|
"segment, an object implementing the :class:`os.PathLike` interface which "
|
|
"returns a string, or another path object::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:116
|
|
msgid "When *pathsegments* is empty, the current directory is assumed::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:121
|
|
msgid ""
|
|
"When several absolute paths are given, the last is taken as an anchor "
|
|
"(mimicking :func:`os.path.join`'s behaviour)::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:129
|
|
msgid ""
|
|
"However, in a Windows path, changing the local root doesn't discard the "
|
|
"previous drive setting::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:135
|
|
msgid ""
|
|
"Spurious slashes and single dots are collapsed, but double dots (``'..'``) "
|
|
"are not, since this would change the meaning of a path in the face of "
|
|
"symbolic links::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:146
|
|
msgid ""
|
|
"(a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent to "
|
|
"``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link to "
|
|
"another directory)"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:150
|
|
msgid ""
|
|
"Pure path objects implement the :class:`os.PathLike` interface, allowing "
|
|
"them to be used anywhere the interface is accepted."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:153
|
|
msgid "Added support for the :class:`os.PathLike` interface."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:158
|
|
msgid ""
|
|
"A subclass of :class:`PurePath`, this path flavour represents non-Windows "
|
|
"filesystem paths::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:164 ../Doc/library/pathlib.rst:174
|
|
#: ../Doc/library/pathlib.rst:591 ../Doc/library/pathlib.rst:601
|
|
#: ../Doc/library/pathlib.rst:611
|
|
msgid "*pathsegments* is specified similarly to :class:`PurePath`."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:168
|
|
msgid ""
|
|
"A subclass of :class:`PurePath`, this path flavour represents Windows "
|
|
"filesystem paths::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:176
|
|
msgid ""
|
|
"Regardless of the system you're running on, you can instantiate all of these "
|
|
"classes, since they don't provide any operation that does system calls."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:181
|
|
msgid "General properties"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:183
|
|
msgid ""
|
|
"Paths are immutable and hashable. Paths of a same flavour are comparable "
|
|
"and orderable. These properties respect the flavour's case-folding "
|
|
"semantics::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:196
|
|
msgid "Paths of a different flavour compare unequal and cannot be ordered::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:207
|
|
msgid "Operators"
|
|
msgstr "Opérateurs"
|
|
|
|
#: ../Doc/library/pathlib.rst:209
|
|
msgid ""
|
|
"The slash operator helps create child paths, similarly to :func:`os.path."
|
|
"join`::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:220
|
|
msgid ""
|
|
"A path object can be used anywhere an object implementing :class:`os."
|
|
"PathLike` is accepted::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:228
|
|
msgid ""
|
|
"The string representation of a path is the raw filesystem path itself (in "
|
|
"native form, e.g. with backslashes under Windows), which you can pass to any "
|
|
"function taking a file path as a string::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:239
|
|
msgid ""
|
|
"Similarly, calling :class:`bytes` on a path gives the raw filesystem path as "
|
|
"a bytes object, as encoded by :func:`os.fsencode`::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:246
|
|
msgid ""
|
|
"Calling :class:`bytes` is only recommended under Unix. Under Windows, the "
|
|
"unicode form is the canonical representation of filesystem paths."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:251
|
|
msgid "Accessing individual parts"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:253
|
|
msgid ""
|
|
"To access the individual \"parts\" (components) of a path, use the following "
|
|
"property:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:258
|
|
msgid "A tuple giving access to the path's various components::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:268
|
|
msgid "(note how the drive and local root are regrouped in a single part)"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:272
|
|
msgid "Methods and properties"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:278
|
|
msgid "Pure paths provide the following methods and properties:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:282
|
|
msgid "A string representing the drive letter or name, if any::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:291
|
|
msgid "UNC shares are also considered drives::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:298
|
|
msgid "A string representing the (local or global) root, if any::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:307
|
|
msgid "UNC shares always have a root::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:314
|
|
msgid "The concatenation of the drive and root::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:328
|
|
msgid ""
|
|
"An immutable sequence providing access to the logical ancestors of the path::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:342
|
|
msgid "The logical parent of the path::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:348
|
|
msgid "You cannot go past an anchor, or empty path::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:358
|
|
msgid "This is a purely lexical operation, hence the following behaviour::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:364
|
|
msgid ""
|
|
"If you want to walk an arbitrary filesystem path upwards, it is recommended "
|
|
"to first call :meth:`Path.resolve` so as to resolve symlinks and eliminate `"
|
|
"\"..\"` components."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:371
|
|
msgid ""
|
|
"A string representing the final path component, excluding the drive and "
|
|
"root, if any::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:377
|
|
msgid "UNC drive names are not considered::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:387
|
|
msgid "The file extension of the final component, if any::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:399
|
|
msgid "A list of the path's file extensions::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:411
|
|
msgid "The final path component, without its suffix::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:423
|
|
msgid ""
|
|
"Return a string representation of the path with forward slashes (``/``)::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:434
|
|
msgid ""
|
|
"Represent the path as a ``file`` URI. :exc:`ValueError` is raised if the "
|
|
"path isn't absolute."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:447
|
|
msgid ""
|
|
"Return whether the path is absolute or not. A path is considered absolute "
|
|
"if it has both a root and (if the flavour allows) a drive::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:467
|
|
msgid ""
|
|
"With :class:`PureWindowsPath`, return ``True`` if the path is considered "
|
|
"reserved under Windows, ``False`` otherwise. With :class:`PurePosixPath`, "
|
|
"``False`` is always returned."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:476
|
|
msgid ""
|
|
"File system calls on reserved paths can fail mysteriously or have unintended "
|
|
"effects."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:482
|
|
msgid ""
|
|
"Calling this method is equivalent to combining the path with each of the "
|
|
"*other* arguments in turn::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:497
|
|
msgid ""
|
|
"Match this path against the provided glob-style pattern. Return ``True`` if "
|
|
"matching is successful, ``False`` otherwise."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:500
|
|
msgid ""
|
|
"If *pattern* is relative, the path can be either relative or absolute, and "
|
|
"matching is done from the right::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:510
|
|
msgid ""
|
|
"If *pattern* is absolute, the path must be absolute, and the whole path must "
|
|
"match::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:518
|
|
msgid "As with other methods, case-sensitivity is observed::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:526
|
|
msgid ""
|
|
"Compute a version of this path relative to the path represented by *other*. "
|
|
"If it's impossible, ValueError is raised::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:544
|
|
msgid ""
|
|
"Return a new path with the :attr:`name` changed. If the original path "
|
|
"doesn't have a name, ValueError is raised::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:561
|
|
msgid ""
|
|
"Return a new path with the :attr:`suffix` changed. If the original path "
|
|
"doesn't have a suffix, the new *suffix* is appended instead::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:576
|
|
msgid "Concrete paths"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:578
|
|
msgid ""
|
|
"Concrete paths are subclasses of the pure path classes. In addition to "
|
|
"operations provided by the latter, they also provide methods to do system "
|
|
"calls on path objects. There are three ways to instantiate concrete paths:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:584
|
|
msgid ""
|
|
"A subclass of :class:`PurePath`, this class represents concrete paths of the "
|
|
"system's path flavour (instantiating it creates either a :class:`PosixPath` "
|
|
"or a :class:`WindowsPath`)::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:595
|
|
msgid ""
|
|
"A subclass of :class:`Path` and :class:`PurePosixPath`, this class "
|
|
"represents concrete non-Windows filesystem paths::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:605
|
|
msgid ""
|
|
"A subclass of :class:`Path` and :class:`PureWindowsPath`, this class "
|
|
"represents concrete Windows filesystem paths::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:613
|
|
msgid ""
|
|
"You can only instantiate the class flavour that corresponds to your system "
|
|
"(allowing system calls on non-compatible path flavours could lead to bugs or "
|
|
"failures in your application)::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:633
|
|
msgid "Methods"
|
|
msgstr "Méthodes"
|
|
|
|
#: ../Doc/library/pathlib.rst:635
|
|
msgid ""
|
|
"Concrete paths provide the following methods in addition to pure paths "
|
|
"methods. Many of these methods can raise an :exc:`OSError` if a system call "
|
|
"fails (for example because the path doesn't exist):"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:641
|
|
msgid ""
|
|
"Return a new path object representing the current directory (as returned by :"
|
|
"func:`os.getcwd`)::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:650
|
|
msgid ""
|
|
"Return a new path object representing the user's home directory (as returned "
|
|
"by :func:`os.path.expanduser` with ``~`` construct)::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:661
|
|
msgid ""
|
|
"Return information about this path (similarly to :func:`os.stat`). The "
|
|
"result is looked up at each call to this method."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:675
|
|
msgid "Change the file mode and permissions, like :func:`os.chmod`::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:687
|
|
msgid "Whether the path points to an existing file or directory::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:699
|
|
msgid ""
|
|
"If the path points to a symlink, :meth:`exists` returns whether the symlink "
|
|
"*points to* an existing file or directory."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:705
|
|
msgid ""
|
|
"Return a new path with expanded ``~`` and ``~user`` constructs, as returned "
|
|
"by :meth:`os.path.expanduser`::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:717
|
|
msgid ""
|
|
"Glob the given *pattern* in the directory represented by this path, yielding "
|
|
"all matching files (of any kind)::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:725
|
|
msgid ""
|
|
"The \"``**``\" pattern means \"this directory and all subdirectories, "
|
|
"recursively\". In other words, it enables recursive globbing::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:736
|
|
msgid ""
|
|
"Using the \"``**``\" pattern in large directory trees may consume an "
|
|
"inordinate amount of time."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:742
|
|
msgid ""
|
|
"Return the name of the group owning the file. :exc:`KeyError` is raised if "
|
|
"the file's gid isn't found in the system database."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:748
|
|
msgid ""
|
|
"Return ``True`` if the path points to a directory (or a symbolic link "
|
|
"pointing to a directory), ``False`` if it points to another kind of file."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:751 ../Doc/library/pathlib.rst:760
|
|
#: ../Doc/library/pathlib.rst:789 ../Doc/library/pathlib.rst:798
|
|
#: ../Doc/library/pathlib.rst:807 ../Doc/library/pathlib.rst:816
|
|
msgid ""
|
|
"``False`` is also returned if the path doesn't exist or is a broken symlink; "
|
|
"other errors (such as permission errors) are propagated."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:757
|
|
msgid ""
|
|
"Return ``True`` if the path points to a regular file (or a symbolic link "
|
|
"pointing to a regular file), ``False`` if it points to another kind of file."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:766
|
|
msgid ""
|
|
"Return ``True`` if the path is a :dfn:`mount point`: a point in a file "
|
|
"system where a different file system has been mounted. On POSIX, the "
|
|
"function checks whether *path*'s parent, :file:`path/..`, is on a different "
|
|
"device than *path*, or whether :file:`path/..` and *path* point to the same "
|
|
"i-node on the same device --- this should detect mount points for all Unix "
|
|
"and POSIX variants. Not implemented on Windows."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:778
|
|
msgid ""
|
|
"Return ``True`` if the path points to a symbolic link, ``False`` otherwise."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:780
|
|
msgid ""
|
|
"``False`` is also returned if the path doesn't exist; other errors (such as "
|
|
"permission errors) are propagated."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:786
|
|
msgid ""
|
|
"Return ``True`` if the path points to a Unix socket (or a symbolic link "
|
|
"pointing to a Unix socket), ``False`` if it points to another kind of file."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:795
|
|
msgid ""
|
|
"Return ``True`` if the path points to a FIFO (or a symbolic link pointing to "
|
|
"a FIFO), ``False`` if it points to another kind of file."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:804
|
|
msgid ""
|
|
"Return ``True`` if the path points to a block device (or a symbolic link "
|
|
"pointing to a block device), ``False`` if it points to another kind of file."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:813
|
|
msgid ""
|
|
"Return ``True`` if the path points to a character device (or a symbolic link "
|
|
"pointing to a character device), ``False`` if it points to another kind of "
|
|
"file."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:822
|
|
msgid ""
|
|
"When the path points to a directory, yield path objects of the directory "
|
|
"contents::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:838
|
|
msgid ""
|
|
"Like :meth:`Path.chmod` but, if the path points to a symbolic link, the "
|
|
"symbolic link's mode is changed rather than its target's."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:844
|
|
msgid ""
|
|
"Like :meth:`Path.stat` but, if the path points to a symbolic link, return "
|
|
"the symbolic link's information rather than its target's."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:850
|
|
msgid ""
|
|
"Create a new directory at this given path. If *mode* is given, it is "
|
|
"combined with the process' ``umask`` value to determine the file mode and "
|
|
"access flags. If the path already exists, :exc:`FileExistsError` is raised."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:855
|
|
msgid ""
|
|
"If *parents* is true, any missing parents of this path are created as "
|
|
"needed; they are created with the default permissions without taking *mode* "
|
|
"into account (mimicking the POSIX ``mkdir -p`` command)."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:859
|
|
msgid ""
|
|
"If *parents* is false (the default), a missing parent raises :exc:"
|
|
"`FileNotFoundError`."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:862
|
|
msgid ""
|
|
"If *exist_ok* is false (the default), :exc:`FileExistsError` is raised if "
|
|
"the target directory already exists."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:865
|
|
msgid ""
|
|
"If *exist_ok* is true, :exc:`FileExistsError` exceptions will be ignored "
|
|
"(same behavior as the POSIX ``mkdir -p`` command), but only if the last path "
|
|
"component is not an existing non-directory file."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:869
|
|
msgid "The *exist_ok* parameter was added."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:875
|
|
msgid ""
|
|
"Open the file pointed to by the path, like the built-in :func:`open` "
|
|
"function does::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:887
|
|
msgid ""
|
|
"Return the name of the user owning the file. :exc:`KeyError` is raised if "
|
|
"the file's uid isn't found in the system database."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:893
|
|
msgid "Return the binary contents of the pointed-to file as a bytes object::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:906
|
|
msgid "Return the decoded contents of the pointed-to file as a string::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:914
|
|
msgid "The optional parameters have the same meaning as in :func:`open`."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:921
|
|
msgid ""
|
|
"Rename this file or directory to the given *target*. On Unix, if *target* "
|
|
"exists and is a file, it will be replaced silently if the user has "
|
|
"permission. *target* can be either a string or another path object::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:936
|
|
msgid ""
|
|
"Rename this file or directory to the given *target*. If *target* points to "
|
|
"an existing file or directory, it will be unconditionally replaced."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:942
|
|
msgid ""
|
|
"Make the path absolute, resolving any symlinks. A new path object is "
|
|
"returned::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:951
|
|
msgid ""
|
|
"\"``..``\" components are also eliminated (this is the only method to do "
|
|
"so)::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:957
|
|
msgid ""
|
|
"If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError` "
|
|
"is raised. If *strict* is ``False``, the path is resolved as far as "
|
|
"possible and any remainder is appended without checking whether it exists. "
|
|
"If an infinite loop is encountered along the resolution path, :exc:"
|
|
"`RuntimeError` is raised."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:963
|
|
msgid "The *strict* argument."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:968
|
|
msgid ""
|
|
"This is like calling :meth:`Path.glob` with \"``**``\" added in front of the "
|
|
"given *pattern*::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:981
|
|
msgid "Remove this directory. The directory must be empty."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:986
|
|
msgid ""
|
|
"Return whether this path points to the same file as *other_path*, which can "
|
|
"be either a Path object, or a string. The semantics are similar to :func:"
|
|
"`os.path.samefile` and :func:`os.path.samestat`."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:990
|
|
msgid ""
|
|
"An :exc:`OSError` can be raised if either file cannot be accessed for some "
|
|
"reason."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1007
|
|
msgid ""
|
|
"Make this path a symbolic link to *target*. Under Windows, "
|
|
"*target_is_directory* must be true (default ``False``) if the link's target "
|
|
"is a directory. Under POSIX, *target_is_directory*'s value is ignored."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1023
|
|
msgid ""
|
|
"The order of arguments (link, target) is the reverse of :func:`os.symlink`'s."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1029
|
|
msgid ""
|
|
"Create a file at this given path. If *mode* is given, it is combined with "
|
|
"the process' ``umask`` value to determine the file mode and access flags. "
|
|
"If the file already exists, the function succeeds if *exist_ok* is true (and "
|
|
"its modification time is updated to the current time), otherwise :exc:"
|
|
"`FileExistsError` is raised."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1038
|
|
msgid ""
|
|
"Remove this file or symbolic link. If the path points to a directory, use :"
|
|
"func:`Path.rmdir` instead."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1044
|
|
msgid ""
|
|
"Open the file pointed to in bytes mode, write *data* to it, and close the "
|
|
"file::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1053
|
|
msgid "An existing file of the same name is overwritten."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1060
|
|
msgid ""
|
|
"Open the file pointed to in text mode, write *data* to it, and close the "
|
|
"file::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1072
|
|
msgid "Correspondence to tools in the :mod:`os` module"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1074
|
|
msgid ""
|
|
"Below is a table mapping various :mod:`os` functions to their corresponding :"
|
|
"class:`PurePath`/:class:`Path` equivalent."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1079
|
|
msgid ""
|
|
"Although :func:`os.path.relpath` and :meth:`PurePath.relative_to` have some "
|
|
"overlapping use-cases, their semantics differ enough to warrant not "
|
|
"considering them equivalent."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1084
|
|
msgid "os and os.path"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1084
|
|
msgid "pathlib"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1086
|
|
msgid ":func:`os.path.abspath`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1086
|
|
msgid ":meth:`Path.resolve`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1087
|
|
msgid ":func:`os.getcwd`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1087
|
|
msgid ":func:`Path.cwd`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1088
|
|
msgid ":func:`os.path.exists`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1088
|
|
msgid ":meth:`Path.exists`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1089
|
|
msgid ":func:`os.path.expanduser`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1089
|
|
msgid ":meth:`Path.expanduser` and :meth:`Path.home`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1091
|
|
msgid ":func:`os.path.isdir`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1091
|
|
msgid ":meth:`Path.is_dir`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1092
|
|
msgid ":func:`os.path.isfile`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1092
|
|
msgid ":meth:`Path.is_file`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1093
|
|
msgid ":func:`os.path.islink`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1093
|
|
msgid ":meth:`Path.is_symlink`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1094
|
|
msgid ":func:`os.stat`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1094
|
|
msgid ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1097
|
|
msgid ":func:`os.path.isabs`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1097
|
|
msgid ":meth:`PurePath.is_absolute`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1098
|
|
msgid ":func:`os.path.join`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1098
|
|
msgid ":func:`PurePath.joinpath`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1099
|
|
msgid ":func:`os.path.basename`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1099
|
|
msgid ":data:`PurePath.name`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1100
|
|
msgid ":func:`os.path.dirname`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1100
|
|
msgid ":data:`PurePath.parent`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1101
|
|
msgid ":func:`os.path.splitext`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/pathlib.rst:1101
|
|
msgid ":data:`PurePath.suffix`"
|
|
msgstr ""
|