Skip to content

node WriteStream and --allow-write permissions doesn't work, regression - 2.4.2 works #30534

@MirKml

Description

@MirKml

Version: Deno 2.4.5.

Seems there is some node WriteStream and --allow-write regression between deno 2.4.2 - 2.4.5

I have some code like

const outputWriteStream = createWriteStream("./__tests__/env.js", {
    encoding: "utf-8",
  });

outputWriteStream.write("something", "utf-8");

and running under windows with --allow-write='./__tests__/env.js' produces some weird error
NotCapable: Requires write access to "\\?\C:\<full-path>\__tests__\env.js"

What is weird, maybe cause of bug, is the start of reported path - \\?\C:\. When I add this full weird path into --allow-write option, It works. But './__tests__/env.js' doesn't work.

Next investigation - when I use Deno.removeSync("./__tests__/env.js") with same --allow-write='./__tests__/env.js' flag. It works.

So it seems that there is some trouble between WriteStream file path and --allow-write permissions check?
On deno 2.4.2 - everything works fine.

If desired, I can create a minimal repro.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions