Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[win][fs] path.toNamespacedPath does nothing #8247

Closed
AlttiRi opened this issue Jan 18, 2024 · 2 comments
Closed

[win][fs] path.toNamespacedPath does nothing #8247

AlttiRi opened this issue Jan 18, 2024 · 2 comments
Assignees
Labels
bug Something isn't working node.js Compatibility with Node.js APIs windows An issue that is known to occur on Windows

Comments

@AlttiRi
Copy link

AlttiRi commented Jan 18, 2024

What version of Bun is running?

1.0.23

What platform is your computer?

Window 10

What steps can reproduce the bug?

import path from "node:path";

const fp1 = "C:\\Downloads\\bun-windows-x64\\bun.exe";
const fp2 = "bun.exe";
const fp3 = "\\\\KEENETIC\\USB";
const fp4 = "\\\\KEENETIC\\USB\\A";
console.log(path.toNamespacedPath(fp1));
console.log(path.toNamespacedPath(fp2));
console.log(path.toNamespacedPath(fp2) === "\\\\?\\" + path.resolve(fp2));
console.log(path.toNamespacedPath(fp3));
console.log(path.toNamespacedPath(fp4));

What is the expected behavior?

\\?\C:\Downloads\bun-windows-x64\bun.exe
\\?\C:\Downloads\bun-windows-x64\bun.exe
true                               
\\?\UNC\KEENETIC\USB\
\\?\UNC\KEENETIC\USB\A

What do you see instead?

C:\Downloads\bun-windows-x64\bun.exe
bun.exe
false
\\KEENETIC\USB
\\KEENETIC\USB\A

Additional information

Rel:

@AlttiRi AlttiRi added the bug Something isn't working label Jan 18, 2024
@Electroid Electroid added node.js Compatibility with Node.js APIs windows An issue that is known to occur on Windows labels Jan 18, 2024
@jdalton
Copy link
Contributor

jdalton commented Jan 22, 2024

Context:
https://nodejs.org/api/path.html#pathtonamespacedpathpath

auto argCount = static_cast<uint16_t>(callFrame->argumentCount());
// TODO:
return JSC::JSValue::encode(callFrame->argument(0));

See zig's wToPrefixedFileW

@paperclover
Copy link
Member

Fixed in #8469

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working node.js Compatibility with Node.js APIs windows An issue that is known to occur on Windows
Projects
None yet
Development

No branches or pull requests

4 participants