13 #ifndef __STOUT_POSIX_FS_HPP__
14 #define __STOUT_POSIX_FS_HPP__
17 #include <sys/statvfs.h>
35 if (::statvfs(path.c_str(), &buf) < 0) {
38 return Bytes(buf.f_blocks * buf.f_frsize);
47 if (statvfs(path.c_str(), &buf) < 0) {
48 return ErrnoError(
"Error invoking statvfs on '" + path +
"'");
50 return (
double) (buf.f_blocks - buf.f_bfree) / buf.f_blocks;
55 const std::string& original,
56 const std::string& link)
58 if (::
symlink(original.c_str(), link.c_str()) < 0) {
82 #endif // __STOUT_POSIX_FS_HPP__
Definition: nothing.hpp:16
Try< Nothing > symlink(const std::string &original, const std::string &link)
Definition: fs.hpp:54
Definition: errorbase.hpp:49
Try< Bytes > size(const std::string &path="/")
Definition: fs.hpp:32
Try< std::list< std::string > > list(const std::string &pattern)
Definition: fs.hpp:75
Try< double > usage(const std::string &path="/")
Definition: fs.hpp:44
Try< std::list< std::string > > glob(const std::string &pattern)
Definition: os.hpp:254