Skip to content

Commit

Permalink
Document maybeLstat
Browse files Browse the repository at this point in the history
Co-authored-by: Théophane Hufschmitt <[email protected]>
  • Loading branch information
Ericson2314 and thufschmitt authored Mar 30, 2024
1 parent 8be347a commit 3752bbe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libutil/file-system.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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<struct stat> maybeLstat(const Path & path);

/**
Expand Down

0 comments on commit 3752bbe

Please sign in to comment.