diff options
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r-- | src/libutil/util.hh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh index 29a70447e..61df6c4f8 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -115,6 +115,12 @@ struct stat stat(const Path & path); struct stat lstat(const Path & path); /** + * `lstat` the given path if it exists. + * @return std::nullopt if the path doesn't exist, or an optional containing the result of `lstat` otherwise + */ +std::optional<struct stat> maybeLstat(const Path & path); + +/** * @return true iff the given path exists. */ bool pathExists(const Path & path); |