Lines Matching refs:fs

72 namespace fs = utils::fs;
151 static void run_mount_tmpfs(const fs::path&, const uint64_t) UTILS_NORETURN;
161 run_mount_tmpfs(const fs::path& mount_point, const uint64_t size) in run_mount_tmpfs()
241 unmount_with_unmount2(const fs::path& mount_point) in unmount_with_unmount2()
247 throw fs::system_error(F("unmount(%s) failed") % mount_point, in unmount_with_unmount2()
261 unmount_with_umount8(const fs::path& mount_point) in unmount_with_umount8()
268 throw fs::system_error("Cannot fork to execute unmount tool", in unmount_with_umount8()
283 throw fs::system_error("Failed to wait for unmount subprocess", in unmount_with_umount8()
291 throw fs::error(F("Failed to unmount %s; returned exit code %s") in unmount_with_umount8()
294 throw fs::error(F("Failed to unmount %s; unmount tool received signal") in unmount_with_umount8()
307 safe_stat(const fs::path& path) in safe_stat()
312 throw fs::system_error(F("Cannot get information about %s") % path, in safe_stat()
330 fs::copy(const fs::path& source, const fs::path& target) in copy()
356 fs::path
357 fs::current_path(void) in current_path()
367 throw fs::system_error(F("Failed to get current working directory"), in current_path()
372 const fs::path result(cwd); in current_path()
390 fs::exists(const fs::path& path) in exists()
402 optional< fs::path >
403 fs::find_in_path(const char* name) in find_in_path()
412 const fs::path candidate = path_component.empty() ? in find_in_path()
413 fs::path(name) : (fs::path(path_component) / name); in find_in_path()
434 fs::free_disk_space(const fs::path& path) in free_disk_space()
440 throw fs::system_error(F("Failed to stat file system for %s") % path, in free_disk_space()
448 throw fs::system_error(F("Failed to stat file system for %s") % path, in free_disk_space()
462 fs::is_directory(const fs::path& path) in is_directory()
476 fs::mkdir(const fs::path& dir, const int mode) in mkdir()
480 throw fs::system_error(F("Failed to create directory %s") % dir, in mkdir()
496 fs::mkdir_p(const fs::path& dir, const int mode) in mkdir_p()
499 fs::mkdir(dir, mode); in mkdir_p()
500 } catch (const fs::system_error& e) { in mkdir_p()
502 fs::mkdir_p(dir.branch_path(), mode); in mkdir_p()
503 fs::mkdir(dir, mode); in mkdir_p()
546 fs::path
547 fs::mkdtemp_public(const std::string& path_template) in mkdtemp_public()
551 const fs::path tmpdir(utils::getenv_with_default("TMPDIR", "/tmp")); in mkdtemp_public()
552 const fs::path full_template = tmpdir / path_template; in mkdtemp_public()
558 throw fs::system_error(F("Cannot create temporary directory using " in mkdtemp_public()
562 const fs::path path(buf.get()); in mkdtemp_public()
569 } catch (const fs::system_error& e) { in mkdtemp_public()
577 throw fs::system_error(F("Failed to grant search permissions on " in mkdtemp_public()
598 fs::path
599 fs::mkstemp(const std::string& path_template) in mkstemp()
603 const fs::path tmpdir(utils::getenv_with_default("TMPDIR", "/tmp")); in mkstemp()
604 const fs::path full_template = tmpdir / path_template; in mkstemp()
610 throw fs::system_error(F("Cannot create temporary file using template " in mkstemp()
613 return fs::path(buf.get()); in mkstemp()
625 fs::mount_tmpfs(const fs::path& in_mount_point) in mount_tmpfs()
640 fs::mount_tmpfs(const fs::path& in_mount_point, const units::bytes& size) in mount_tmpfs()
644 const fs::path mount_point = in_mount_point.is_absolute() ? in mount_tmpfs()
650 throw fs::system_error("Cannot fork to execute mount tool", in mount_tmpfs()
662 throw fs::system_error("Failed to wait for mount subprocess", in mount_tmpfs()
668 throw fs::unsupported_operation_error( in mount_tmpfs()
673 throw fs::error(F("Failed to mount tmpfs on %s; returned exit " in mount_tmpfs()
676 throw fs::error(F("Failed to mount tmpfs on %s; mount tool " in mount_tmpfs()
691 fs::rm_r(const fs::path& directory) in rm_r()
693 const fs::directory dir(directory); in rm_r()
695 for (fs::directory::const_iterator iter = dir.begin(); iter != dir.end(); in rm_r()
700 const fs::path entry = directory / iter->name; in rm_r()
702 if (fs::is_directory(entry)) { in rm_r()
704 fs::rm_r(entry); in rm_r()
707 fs::unlink(entry); in rm_r()
712 fs::rmdir(directory); in rm_r()
722 fs::rmdir(const path& file) in rmdir()
726 throw fs::system_error(F("Removal of %s failed") % file, in rmdir()
739 std::set< fs::directory_entry >
740 fs::scan_directory(const fs::path& path) in scan_directory()
742 std::set< fs::directory_entry > contents; in scan_directory()
744 fs::directory dir(path); in scan_directory()
745 for (fs::directory::const_iterator iter = dir.begin(); iter != dir.end(); in scan_directory()
760 fs::unlink(const path& file) in unlink()
764 throw fs::system_error(F("Removal of %s failed") % file, in unlink()
776 fs::unmount(const fs::path& in_mount_point) in unmount()
780 const fs::path mount_point = in_mount_point.is_absolute() ? in unmount()
794 } catch (const fs::system_error& error) { in unmount()