aboutsummaryrefslogtreecommitdiff
path: root/build/filesystem
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-06-18 14:41:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-06-18 14:41:45 +0200
commit63e7a4a77cb8ceed7b42561fe3202b0b48d86db6 (patch)
treebde5a79522225f32ec188ba46d0834486c30f00f /build/filesystem
parent28c82c861e38fe05a25e916563e0551ed8fce91e (diff)
Move path and filesystem from build2 to libbutl
Diffstat (limited to 'build/filesystem')
-rw-r--r--build/filesystem61
1 files changed, 0 insertions, 61 deletions
diff --git a/build/filesystem b/build/filesystem
deleted file mode 100644
index fbade4f..0000000
--- a/build/filesystem
+++ /dev/null
@@ -1,61 +0,0 @@
-// file : build/filesystem -*- C++ -*-
-// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
-// license : MIT; see accompanying LICENSE file
-
-#ifndef BUILD_FILESYSTEM
-#define BUILD_FILESYSTEM
-
-#include <sys/types.h> // mode_t
-
-#include <build/path>
-
-namespace build
-{
- // Return true if the path is to an existing directory. Note that
- // this function resolves symlinks.
- //
- bool
- dir_exists (const path&);
-
- // Return true if the path is to an existing regular file. Note that
- // this function resolves symlinks.
- //
- bool
- file_exists (const path&);
-
- // 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.
- //
- // 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
- // reported by throwing std::system_error.
- //
- enum class rmdir_status {success, not_exist, not_empty};
-
- rmdir_status
- try_rmdir (const path&);
-
- // Try to remove the file (or symbolic link) returning not_exist if
- // it does not exist. All other errors are reported by throwing
- // std::system_error.
- //
- enum class rmfile_status {success, not_exist};
-
- rmfile_status
- try_rmfile (const path&);
-}
-
-#endif // BUILD_FILESYSTEM