summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-11-02 13:30:41 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-11-02 13:31:01 (GMT)
commit0f02655bb01346cab483761bd75fa8dc6cbfe7f1 (patch)
treeb51a2341094b4aa3bb24ed0661da6dcde6ac0a99 /Help
parent83a85264b406c5197e0ce780cd238626afa6f4ed (diff)
parent337bc5662c35acce32630bfa26e87a42d472726f (diff)
downloadCMake-0f02655bb01346cab483761bd75fa8dc6cbfe7f1.zip
CMake-0f02655bb01346cab483761bd75fa8dc6cbfe7f1.tar.gz
CMake-0f02655bb01346cab483761bd75fa8dc6cbfe7f1.tar.bz2
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
Diffstat (limited to 'Help')
-rw-r--r--Help/command/if.rst41
-rw-r--r--Help/release/dev/if-check-file-permissions.rst5
2 files changed, 46 insertions, 0 deletions
diff --git a/Help/command/if.rst b/Help/command/if.rst
index 5d85a1f..1afbe04 100644
--- a/Help/command/if.rst
+++ b/Help/command/if.rst
@@ -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
diff --git a/Help/release/dev/if-check-file-permissions.rst b/Help/release/dev/if-check-file-permissions.rst
new file mode 100644
index 0000000..ec69b00
--- /dev/null
+++ b/Help/release/dev/if-check-file-permissions.rst
@@ -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.