Skip to content

Tracking Issue for dir_entry_ext2 #85573

Open

Description

@arennow

Feature gate: #![feature(dir_entry_ext2)]

This is a tracking issue for a new method on std::fs::DirEntry on UNIX platforms via a new sealed variant of the std::os::unix::fs::DirEntryExt trait.

Public API

#[unstable(feature = "dir_entry_ext2")]
pub trait DirEntryExt2: Sealed {
    fn file_name_ref(&self) -> &OsStr;
}

Steps / History

Unresolved Questions

  • What is an appropriate name for this new trait?

Activity

  1. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    T-libs-api[DEPRECATED; DO NOT USE]
    on May 22, 2021
  2. added
    A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`
    on Jul 5, 2021
  3. marcospb19 commented on Oct 5, 2021

    @marcospb19
    Contributor

    Hey, @arennow and @m-ou-se, is it possible to have an owned version of this function?

    (self) -> OsString

    Something like this in the trait

    #[unstable(feature = "dir_entry_ext2")]
    pub trait DirEntryExt2: Sealed {
        fn file_name_ref(&self) -> &OsStr;
        fn into_file_name(self) -> OsStr;
    }
  4. tavianator commented on Feb 22, 2022

    @tavianator
    Contributor

    @marcospb19 An owned version is already available from DirEntry::file_name()

  5. mic006 commented on Apr 3, 2023

    @mic006

    Hi @arennow and @m-ou-se

    Is it planned to make this change stable in a coming release ?
    The change seems to be a good optimization (typically for sorting DirEntry-s), without any risk of issue.

  6. cgwalters commented on Jun 27, 2024

    @cgwalters
    Contributor

    Another year later: I also came across this one after writing some code to sort directory entries and thinking about the allocations involved.

    It looks like we got hung up previously on the extension trait sealing: #83581 (comment)

    I guess we need another crater run?

  7. added
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    and removed
    T-libs-api[DEPRECATED; DO NOT USE]
    on Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libsRelevant to the library 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