Skip to content

fs.realpathSync does not behave expected #60779

@siaeyy

Description

@siaeyy

Version

26.0.0-pre

Platform

archlinux x86_64

Subsystem

fs

What steps will reproduce the bug?

mkdir -p folder/nested/
ln -s folder/nested/ ./symlink-dir
const fs = require("fs");
const assert = require("assert");

const a = fs.realpathSync('./symlink-dir/..');
const b = fs.realpathSync('./folder');

assert.equal(a, b);

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

Expected behavior is same as native realpath:

$ realpath ./symlink-dir/..
/folder
$ realpath ./folder
/folder

What do you see instead?

AssertionError

Additional information

Refs: #60715, #60715 (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

    No branches or pull requests

    Issue actions