Skip to content

No cross-platform way to close an fs::File and check for errors #32255

Closed
@reem

Description

@reem

There should be an: fn close(self) -> io::Result<()> that does the same as Drop but does not swallow any errors. Currently the only way to do this is with into_raw_fd and libc::close, which is both unergonomic and non-cross-platform.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-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