mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:38:10 +00:00
LibFileSystem: Add a helper to get the file size from fstat
This commit is contained in:
parent
896f213c6f
commit
a70d79ff98
2 changed files with 7 additions and 0 deletions
|
@ -356,6 +356,12 @@ ErrorOr<off_t> size_from_stat(StringView path)
|
|||
return st.st_size;
|
||||
}
|
||||
|
||||
ErrorOr<off_t> size_from_fstat(int fd)
|
||||
{
|
||||
auto st = TRY(Core::System::fstat(fd));
|
||||
return st.st_size;
|
||||
}
|
||||
|
||||
bool can_delete_or_move(StringView path)
|
||||
{
|
||||
VERIFY(!path.is_empty());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue