Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b9831ab6
Commit
b9831ab6
authored
Jun 24, 2012
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Linux-only *xattr() functions to their own subheading.
parent
7ac2af78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
84 deletions
+75
-84
Doc/library/os.rst
Doc/library/os.rst
+75
-84
No files found.
Doc/library/os.rst
View file @
b9831ab6
...
@@ -1422,20 +1422,6 @@ features:
...
@@ -1422,20 +1422,6 @@ features:
and the *dir_fd* and *follow_symlinks* arguments.
and the *dir_fd* and *follow_symlinks* arguments.
.. function:: getxattr(path, attribute, *, follow_symlinks=True)
Return the value of the extended filesystem attribute *attribute* for
*path*. *attribute* can be bytes or str. If it is str, it is encoded
with the filesystem encoding.
This function can support :ref:`specifying a file descriptor <path_fd>` and
:ref:`not following symlinks <follow_symlinks>`.
Availability: Linux.
.. versionadded:: 3.3
.. function:: lchflags(path, flags)
.. function:: lchflags(path, flags)
Set the flags of *path* to the numeric *flags*, like :func:`chflags`, but do
Set the flags of *path* to the numeric *flags*, like :func:`chflags`, but do
...
@@ -1511,21 +1497,6 @@ features:
...
@@ -1511,21 +1497,6 @@ features:
Added support for specifying an open file descriptor for *path*.
Added support for specifying an open file descriptor for *path*.
.. function:: listxattr(path=None, *, follow_symlinks=True)
Return a list of the extended filesystem attributes on *path*. The
attributes in the list are represented as strings decoded with the filesystem
encoding. If *path* is ``None``, :func:`listxattr` will examine the current
directory.
This function can support :ref:`specifying a file descriptor <path_fd>` and
:ref:`not following symlinks <follow_symlinks>`.
Availability: Linux.
.. versionadded:: 3.3
.. function:: lstat(path, *, dir_fd=None)
.. function:: lstat(path, *, dir_fd=None)
Perform the equivalent of an :c:func:`lstat` system call on the given path.
Perform the equivalent of an :c:func:`lstat` system call on the given path.
...
@@ -1726,20 +1697,6 @@ features:
...
@@ -1726,20 +1697,6 @@ features:
successfully removed.
successfully removed.
.. function:: removexattr(path, attribute, *, follow_symlinks=True)
Removes the extended filesystem attribute *attribute* from *path*.
*attribute* should be bytes or str. If it is a string, it is encoded
with the filesystem encoding.
This function can support :ref:`specifying a file descriptor <path_fd>` and
:ref:`not following symlinks <follow_symlinks>`.
Availability: Linux.
.. versionadded:: 3.3
.. function:: rename(src, dst, *, src_dir_fd=None, dst_dir_fd=None)
.. function:: rename(src, dst, *, src_dir_fd=None, dst_dir_fd=None)
Rename the file or directory *src* to *dst*. If *dst* is a directory,
Rename the file or directory *src* to *dst*. If *dst* is a directory,
...
@@ -1817,47 +1774,6 @@ features:
...
@@ -1817,47 +1774,6 @@ features:
The *dir_fd* parameter.
The *dir_fd* parameter.
.. data:: XATTR_SIZE_MAX
The maximum size the value of an extended attribute can be. Currently, this
is 64 kilobytes on Linux.
.. data:: XATTR_CREATE
This is a possible value for the flags argument in :func:`setxattr`. It
indicates the operation must create an attribute.
.. data:: XATTR_REPLACE
This is a possible value for the flags argument in :func:`setxattr`. It
indicates the operation must replace an existing attribute.
.. function:: setxattr(path, attribute, value, flags=0, *, follow_symlinks=True)
Set the extended filesystem attribute *attribute* on *path* to *value*.
*attribute* must be a bytes or str with no embedded NULs. If it is a str,
it is encoded with the filesystem encoding. *flags* may be
:data:`XATTR_REPLACE` or :data:`XATTR_CREATE`. If :data:`XATTR_REPLACE` is
given and the attribute does not exist, ``EEXISTS`` will be raised.
If :data:`XATTR_CREATE` is given and the attribute already exists, the
attribute will not be created and ``ENODATA`` will be raised.
This function can support :ref:`specifying a file descriptor <path_fd>` and
:ref:`not following symlinks <follow_symlinks>`.
Availability: Linux.
.. note::
A bug in Linux kernel versions less than 2.6.39 caused the flags argument
to be ignored on some filesystems.
.. versionadded:: 3.3
.. function:: stat(path, *, dir_fd=None, follow_symlinks=True)
.. function:: stat(path, *, dir_fd=None, follow_symlinks=True)
Perform the equivalent of a :c:func:`stat` system call on the given path.
Perform the equivalent of a :c:func:`stat` system call on the given path.
...
@@ -2334,6 +2250,81 @@ features:
...
@@ -2334,6 +2250,81 @@ features:
.. versionadded:: 3.3
.. versionadded:: 3.3
Linux extended attributes
~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 3.3
These functions are all available on Linux only.
.. function:: getxattr(path, attribute, *, follow_symlinks=True)
Return the value of the extended filesystem attribute *attribute* for
*path*. *attribute* can be bytes or str. If it is str, it is encoded
with the filesystem encoding.
This function can support :ref:`specifying a file descriptor <path_fd>` and
:ref:`not following symlinks <follow_symlinks>`.
.. function:: listxattr(path=None, *, follow_symlinks=True)
Return a list of the extended filesystem attributes on *path*. The
attributes in the list are represented as strings decoded with the filesystem
encoding. If *path* is ``None``, :func:`listxattr` will examine the current
directory.
This function can support :ref:`specifying a file descriptor <path_fd>` and
:ref:`not following symlinks <follow_symlinks>`.
.. function:: removexattr(path, attribute, *, follow_symlinks=True)
Removes the extended filesystem attribute *attribute* from *path*.
*attribute* should be bytes or str. If it is a string, it is encoded
with the filesystem encoding.
This function can support :ref:`specifying a file descriptor <path_fd>` and
:ref:`not following symlinks <follow_symlinks>`.
.. function:: setxattr(path, attribute, value, flags=0, *, follow_symlinks=True)
Set the extended filesystem attribute *attribute* on *path* to *value*.
*attribute* must be a bytes or str with no embedded NULs. If it is a str,
it is encoded with the filesystem encoding. *flags* may be
:data:`XATTR_REPLACE` or :data:`XATTR_CREATE`. If :data:`XATTR_REPLACE` is
given and the attribute does not exist, ``EEXISTS`` will be raised.
If :data:`XATTR_CREATE` is given and the attribute already exists, the
attribute will not be created and ``ENODATA`` will be raised.
This function can support :ref:`specifying a file descriptor <path_fd>` and
:ref:`not following symlinks <follow_symlinks>`.
.. note::
A bug in Linux kernel versions less than 2.6.39 caused the flags argument
to be ignored on some filesystems.
.. data:: XATTR_SIZE_MAX
The maximum size the value of an extended attribute can be. Currently, this
is 64 kilobytes on Linux.
.. data:: XATTR_CREATE
This is a possible value for the flags argument in :func:`setxattr`. It
indicates the operation must create an attribute.
.. data:: XATTR_REPLACE
This is a possible value for the flags argument in :func:`setxattr`. It
indicates the operation must replace an existing attribute.
.. _os-process:
.. _os-process:
Process Management
Process Management
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment