Skip to content

rename() fails with trailing slash #1008

@ericeil

Description

@ericeil

Tested on rs_preview build 14905:

Run the following:

#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>

int main(void)
{
    if (mkdir("dir1", 0777) != 0)
        err(1, "mkdir errno %d", errno);

    if (rename("dir1", "dir2/") != 0)
        err(1, "rename errno %d", errno);

    return 0;
}

On Linux, this succeeds. On Windows, I get the following:

a.out: rename errno 2: No such file or directory

Without the trailing slash, the rename works as expected.

This is causing a few failures in the .NET Core tests.

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