mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibFileSystem: Add a method to query disk space stats
This returns the amount of free and total disk space for the partition of a provided path.
This commit is contained in:
Notes:
github-actions[bot]
2026-02-13 15:22:48 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/551b82ae0ba Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7776
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/Error.h>
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <LibCore/File.h>
|
||||
|
||||
@@ -65,4 +66,10 @@ ErrorOr<off_t> size_from_stat(StringView path);
|
||||
ErrorOr<off_t> size_from_fstat(int fd);
|
||||
bool can_delete_or_move(StringView path);
|
||||
|
||||
struct DiskSpace {
|
||||
u64 free_bytes { 0 };
|
||||
u64 total_bytes { 0 };
|
||||
};
|
||||
ErrorOr<DiskSpace> compute_disk_space(LexicalPath const&);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user