0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd::fs: Add a file sizing suite.

This commit is contained in:
Jason Volk 2017-12-20 17:33:12 -07:00
parent fbf07913f7
commit 27721860c2
2 changed files with 15 additions and 0 deletions

View file

@ -82,6 +82,9 @@ namespace ircd::fs
bool is_dir(const std::string &path);
bool is_reg(const std::string &path);
size_t size(const std::string &path);
size_t size(const string_view &path);
std::vector<std::string> ls(const std::string &path);
std::vector<std::string> ls_recursive(const std::string &path);

View file

@ -246,6 +246,18 @@ catch(const fs::filesystem_error &e)
throw filesystem_error("%s", e.what());
}
size_t
ircd::fs::size(const string_view &path)
{
return ircd::fs::size(std::string{path});
}
size_t
ircd::fs::size(const std::string &path)
{
return fs::file_size(path);
}
bool
ircd::fs::is_reg(const std::string &path)
try