# What file permissions do find\_{library,path,file} require?

**URL:** https://discourse.cmake.org/t/what-file-permissions-do-find-library-path-file-require/13849
**Category:** Development
**Created:** [March 28, 2025, 9:51pm UTC](https://discourse.cmake.org/t/what-file-permissions-do-find-library-path-file-require/13849 "2025-03-28T21:51:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [March 28, 2025, 9:51pm UTC](https://discourse.cmake.org/t/what-file-permissions-do-find-library-path-file-require/13849/1 "2025-03-28T21:51:27Z")

</div>

Recently [CMP0109](https://cmake.org/cmake/help/latest/policy/CMP0109.html) was added to find\_program to clarify sensible file permissions required for find\_program() to stop and declare a program as found.

What is the official behavior regarding file permissions required for: find\_path(), find\_file(), find\_library()?

I believe this behavior should be documented. For example, should simply existence be enough, even if the file is not readable or executable?

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [March 28, 2025, 11:27pm UTC](https://discourse.cmake.org/t/what-file-permissions-do-find-library-path-file-require/13849/2 "2025-03-28T23:27:28Z")

</div>

I would not expect anything other than existence to be relevant for `find_path()`, `find_file()`, or `find_library()`. CMake has no idea what you want to do with the thing you’re finding with those commands. The `find_program()` case is special because the primary reason for using it is to find a program you want to execute, and for that to be useful, the program must be executable. For any other use case, you should probably use `find_file()` instead.

I don’t think any change to the docs is needed. We don’t normally document things a command _doesn’t_ do, unless it goes against conventions or other such cases. If the docs don’t mention any requirements around permissions for `find_path()`, `find_file()`, or `find_library()`, then you can reasonably expect there are no such requirements.

---

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [March 31, 2025, 9:48pm UTC](https://discourse.cmake.org/t/what-file-permissions-do-find-library-path-file-require/13849/3 "2025-03-31T21:48:31Z")

</div>

I did an [experiment](https://gist.github.com/scivision/6cd88d4b7b084169a7aa182f70741614) that shows on Unix-like file systems (e.g. Linux) read permission is required for find\_library, etc. to find the file.

I plan to make a Help MR to document this.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [July 20, 2025, 2:37am UTC](https://discourse.cmake.org/t/what-file-permissions-do-find-library-path-file-require/13849/4 "2025-07-20T02:37:23Z")

</div>

> [@scivision](#):
>
> I plan to make a Help MR to document this.

Was this ever done? I don’t see it in the docs today.
