mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-30 21:28:40 +00:00
LibFileSystem: Add a helper to get the file size from fstat
This commit is contained in:
committed by
Andrew Kaster
parent
896f213c6f
commit
a70d79ff98
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user