Merge topic 'if-check-file-permissions'

337bc5662c if(): add operators IS_READABLE, IS_WRITABLE and IS_EXECUTABLE.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8908
This commit is contained in:
Brad King
2023-11-02 13:30:41 +00:00
committed by Kitware Robot
6 changed files with 238 additions and 1 deletions
+41
View File
@@ -178,6 +178,47 @@ File Operations
False if the given path is an empty string.
.. warning::
To check the readability of a file, use preferably ``if(IS_READABLE)``
because this test will evolve to check file existence only in a future
release.
.. signature:: if(IS_READABLE <path-to-file-or-directory>)
.. versionadded:: 3.29
True if the named file or directory is readable. Behavior
is well-defined only for explicit full paths (a leading ``~/`` is not
expanded as a home directory and is considered a relative path).
Resolves symbolic links, i.e. if the named file or directory is a
symbolic link, returns true if the target of the symbolic link is readable.
False if the given path is an empty string.
.. signature:: if(IS_WRITABLE <path-to-file-or-directory>)
.. versionadded:: 3.29
True if the named file or directory is writable. Behavior
is well-defined only for explicit full paths (a leading ``~/`` is not
expanded as a home directory and is considered a relative path).
Resolves symbolic links, i.e. if the named file or directory is a
symbolic link, returns true if the target of the symbolic link is writable.
False if the given path is an empty string.
.. signature:: if(IS_EXECUTABLE <path-to-file-or-directory>)
.. versionadded:: 3.29
True if the named file or directory is executable. Behavior
is well-defined only for explicit full paths (a leading ``~/`` is not
expanded as a home directory and is considered a relative path).
Resolves symbolic links, i.e. if the named file or directory is a
symbolic link, returns true if the target of the symbolic link is executable.
False if the given path is an empty string.
.. signature:: if(<file1> IS_NEWER_THAN <file2>)
:target: IS_NEWER_THAN
@@ -0,0 +1,5 @@
if-check-file-permissions
-------------------------
* The :command:`if` command gained new tests ``IS_READABLE``, ``IS_WRITABLE``
and ``IS_EXECUTABLE`` to check file or directory permissions.