add file size to FileEngine (#2323)

This commit is contained in:
Chris Rogus authored and GitHub committed 2024-06-10 20:48:36 -07:00
1 parent 9d55bfc1dc
commit d0f0548776
3 files changed
+18

No files matched your search

@@ -25,6 +25,11 @@ impl FileEngine for NativeFileEngine {
.collect()
}
async fn file_size(&self, file: &str) -> Option<u64> {
let file = File::open(file).await.ok()?;
Some(file.metadata().await.ok()?.len())
}
async fn read_file(&self, file: &str) -> Option<Vec<u8>> {
let mut file = File::open(file).await.ok()?;