Skip to content

bug: Missing file size and access times for services-fs lister #7187

@matthambrecht

Description

@matthambrecht

Describe the bug

Currently if you use the fs service's lister and attempt to view the metadata it only returns type defaults so sizes are always 0 and access times are always undefined.

Steps to Reproduce

use opendal::{self, Operator};
use futures_util::TryStreamExt;

#[tokio::main]
async fn main() {
    let operator = Operator::from_uri("fs:///tmp/test_dir").unwrap();
    let lister = operator.lister("/").await.unwrap();
    let entries = lister.try_collect::<Vec<_>>().await.unwrap(); 

   for entry in entries {
        let metadata = entry.metadata();
        println!("Metadata: {:#?}", metadata)
    }
}

Expected Behavior

Should serve the file's size and time of last access.

Additional Context

No response

Are you willing to submit a PR to fix this bug?

  • Yes, I would like to submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions