Skip to content

Unify File.Replace Unix and Windows exception throwing behavior #49796

@mikernet

Description

@mikernet

Description

using (File.Create("test.txt")) {}
Directory.CreateDirectory("test");
			
// Correct - throws IOExeption with message "Is a directory"
File.Replace("test.txt", "test", null);

// Incorrect = throws IOExeption with message "Not a directory"
File.Replace("test", "test.txt", null);

Configuration

.NET 5 on Linux.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions