From 41d60b544b5b079e2ae27d919ae450a0e00d9ec5 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 30 Mar 2024 10:39:25 -0400 Subject: [PATCH] Document `maybeLstat` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com> (cherry picked from commit 3752bbef28899bc05e2e144fae5dcf37d99f86b5) --- src/libutil/file-system.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libutil/file-system.hh b/src/libutil/file-system.hh index b570875b5..dfd339025 100644 --- a/src/libutil/file-system.hh +++ b/src/libutil/file-system.hh @@ -84,6 +84,10 @@ bool isDirOrInDir(std::string_view path, std::string_view dir); */ 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 maybeLstat(const Path & path); /**