Skip to content

existsSync does not work on files containing a : on macOS #57929

@maziac

Description

@maziac

Version

23.10.0

Platform

macOS: 15.4.1 
Apple M2

Subsystem

fs

What steps will reproduce the bug?

  1. In the Finder on Mac create a folder which contains a \ , e.g. "a\b"
  2. In a terminal do an "ls", you will find "a:b" as the folder name
  3. Now when using the fs package use the existsSync function
    Result: The folder is not found.
import * as fs from 'fs';
...
const folder = "a:b";
if (fs.existsSync(folder))
	console.log("found");
else
	console.log("not found");

Note: you have to use absolute paths according to where you create the folder:

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

Always

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

existsSync should find the folder.

What do you see instead?

existsSync does not find the folder.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to the fs subsystem / file system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions