X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fpbd%2Fpbd%2Ffile_utils.h;h=72696f6abdf40484d044e4235f15c4f43d960f58;hb=a1a8794dadc0ab972f441481594b53117df1ca92;hp=475ddb982855d00d4a8f126be6d00a1adae6a644;hpb=e66e9854d7dac2e76753b74f3fe0eb323ac35f4f;p=ardour.git diff --git a/libs/pbd/pbd/file_utils.h b/libs/pbd/pbd/file_utils.h index 475ddb9828..72696f6abd 100644 --- a/libs/pbd/pbd/file_utils.h +++ b/libs/pbd/pbd/file_utils.h @@ -105,6 +105,31 @@ bool copy_file(const std::string & from_path, const std::string & to_path); */ void copy_files(const std::string & from_path, const std::string & to_dir); +/** + * Take a (possibly) relative path and make it absolute + * @return An absolute path + */ +std::string get_absolute_path (const std::string &); + +/** + * Find out if `needle' is a file or directory within the + * directory `haystack'. + * @return true if it is. + */ +bool path_is_within (const std::string &, std::string); + +/** + * @return true if p1 and p2 both resolve to the same file + * @param p1 a file path. + * @param p2 a file path. + * + * Uses g_stat to check for identical st_dev and st_ino values. + */ +bool equivalent_paths (const std::string &p1, const std::string &p2); + +/// @return true if path at p exists and is writable, false otherwise +bool exists_and_writable(const std::string & p); + } // namespace PBD #endif