add file size to FileEngine (#2323)
This commit is contained in:
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()?;
|
||||
|
||||
|
||||
Reference in new issue
Block a user