Skip to content

os::copy_file does not clean after failure. #9947

Closed
@dpc

Description

@dpc
Contributor

If you eg. give os::copy_file source argument that is a directory it will leave an empty destination file. I belive this is not good, and may lead to terrible, hard to debug bugs in software using it.

Activity

hatahet

hatahet commented on Oct 20, 2013

@hatahet
Contributor

Does this happen on *nix, Windows, or either?

hatahet

hatahet commented on Oct 20, 2013

@hatahet
Contributor

Also seems to fail if the source and destination files are the same. The resulting file is empty.

hatahet

hatahet commented on Oct 20, 2013

@hatahet
Contributor
dpc

dpc commented on Oct 24, 2013

@dpc
ContributorAuthor

I've tested this on Linux.

added a commit that references this issue on Oct 30, 2013
emberian

emberian commented on Apr 7, 2014

@emberian
Member

std::io::fs::open appears to not does this? #10175 modified some behavior around this. @dpc can you try and reproduce on master?

steveklabnik

steveklabnik commented on Jan 23, 2015

@steveklabnik
Member

We no longer have os::copy_file, and as @cmr asks, I think this just works now. @dpc if you think this is still an issue, please reproduce and let us know :)

added a commit that references this issue on Dec 29, 2022

Auto merge of rust-lang#10109 - Niki4tap:yeet_not_return, r=flip1995

f0d331a
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @dpc@steveklabnik@emberian@hatahet

      Issue actions

        `os::copy_file` does not clean after failure. · Issue #9947 · rust-lang/rust