Skip to content

rename - does not work for directories #1173

@arturaskaukenas

Description

@arturaskaukenas

File.Move(fromPath, toPath);

public override bool Rename(string fromPath, string toPath, StreamRenameOptions options, StreamContext context)
{
    try
    {
        File.Move(fromPath, toPath);
        return true;
    }
    ...
}

This breaks PHP compatibility because File.Move() cannot move directories.
In PHP, rename() works for both files and directories and does not require distinguishing between them.

.NET requires different APIs:
File.Move() → files only
Directory.Move() → directories only

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions