Skip to content

Tracking Issue for feature(file_set_times): FileTimes and File::set_times #98245

Closed

Description

Feature gate: #![feature(file_set_times)]

This is a tracking issue for setting file accesses/modification timestamps via the File::set_times function and associated FileTimes structure.

Public API

// std::fs

#[derive(Copy, Clone, Debug, Default)]
pub struct FileTimes { /* ... */ };

impl FileTimes {
    pub fn new() -> Self;
    pub fn set_accessed(self, t: SystemTime) -> Self;
    pub fn set_modified(self, t: SystemTime) -> Self;
}

impl File {
    pub fn set_times(&self, times: FileTimes) -> std::io::Result<()>;
    pub fn set_modified(&self, t: SystemTime) -> std::io::Result<()>;
}
// std::os::ios::fs
// std::os::macos::fs
// std::os::watchos::fs
// std::os::windows::fs

pub trait FileTimesExt: Sealed {
    fn set_created(self, t: SystemTime) -> Self;
}

impl FileTimesExt for std::fs::FileTimes;

Steps / History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: A tracking issue for an RFC or an unstable feature.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions