diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-29 18:51:07 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-29 18:51:07 +0200 |
commit | 807bb530ecf6cde6c13956a20f64db32e86b892e (patch) | |
tree | a8e3b942717b17b8b4bbb6c39c8def9c1f5406fa /butl/filesystem | |
parent | 135a0bcb957dc836c425f51eeeeae4148092fdf8 (diff) |
Add flag to file_exists() not to follow symlinks
Diffstat (limited to 'butl/filesystem')
-rw-r--r-- | butl/filesystem | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/butl/filesystem b/butl/filesystem index 4b4af6a..6f199c9 100644 --- a/butl/filesystem +++ b/butl/filesystem @@ -32,17 +32,18 @@ namespace butl { - // Return true if the path is to an existing regular file. Note that - // this function resolves symlinks. + // Return true if the path is to an existing regular file. Note that by + // default this function follows symlinks. // LIBBUTL_EXPORT bool - file_exists (const char*); + file_exists (const char*, bool follow_symlinks = true); inline bool - file_exists (const path& p) {return file_exists (p.string ().c_str ());} + file_exists (const path& p, bool fs = true) { + return file_exists (p.string ().c_str (), fs);} - // Return true if the path is to an existing directory. Note that - // this function resolves symlinks. + // Return true if the path is to an existing directory. Note that this + // function follows symlinks. // LIBBUTL_EXPORT bool dir_exists (const char*); |