From cd75e06a87aa74aa6968113107afa53d401d20bc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 25 Mar 2015 14:48:36 +0200 Subject: Configure/disfigure src_root saving/removing support; fsdir{} injection We can now build out-of-tree. --- build/filesystem | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'build/filesystem') diff --git a/build/filesystem b/build/filesystem index c96e669..8617dd4 100644 --- a/build/filesystem +++ b/build/filesystem @@ -23,13 +23,21 @@ namespace build bool file_exists (const path&); - - // Note that you should probably use the default mode 0777 and let - // the umask mechanism adjust it to the user's preferences. Errors - // are reported by throwing std::system_error. + // Try to create a directory unless it already exists. If you expect + // the directory to exist and performance is important, then you + // should first call dir_exists() above since that's what this + // implementation will do to make sure the path is actually a + // directory. + // + // You should also probably use the default mode 0777 and let the + // umask mechanism adjust it to the user's preferences. // - void - mkdir (const path&, mode_t = 0777); + // Errors are reported by throwing std::system_error. + // + enum class mkdir_status {success, already_exists}; + + mkdir_status + try_mkdir (const path&, mode_t = 0777); // Try to remove the directory returning not_exist if it does not // exist and not_empty if it is not empty. All other errors are -- cgit v1.1