Skip to content

fs::rename behavior differs on windows #15836

Closed
@alexcrichton

Description

@alexcrichton

This program will succeed on unix but fail to succeed on windows. The unix behavior is surprising to me!

use std::io::{fs, UserRWX};

fn main() {
    fs::mkdir(&Path::new("test"), UserRWX).unwrap();
    fs::mkdir(&Path::new("test2"), UserRWX).unwrap();
    fs::rename(&Path::new("test"), &Path::new("test2")).unwrap();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions