Skip to content

Tracking Issue for windows_change_time #121478

Open
@juliusl

Description

@juliusl

In Windows, there's a field in FILE_BASIC_INFO called ChangeTime that tracks when file metadata is changed, such as renaming, file attributes, etc.

Currently, this property isn't included in the ::sys::windows::fs::FileAttr implementation, but is available in the c::FILE_BASIC_INFO impl.

Last write time (which is currently provided) is the last time the data stream changed, and this value represents a different time value.

source

This change adds a method change_time() to the MetadataExt trait in order to provide this value.

Public API

fn windows_change_time() {
    let meta = std::fs::metadata("example.txt").unwrap();

    // Returns Option<u64> since this is only available if FILE_BASIC_INFO is the backing type of `.inner()`
    let change_time = meta.change_time();
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions