Skip to content

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

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.

Activity

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

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-libs-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions