vercel / pkg

Package your Node.js project into an executable
https://npmjs.com/pkg
MIT License
24.33k stars 1.02k forks source link

Reading the root of a drive on windows results extra 'snapshot' directory #1929

Closed vicapow closed 10 months ago

vicapow commented 1 year ago

What version of pkg are you using?

5.8.0

What version of Node.js are you using?

v10.23.1

What operating system are you using?

windows

What CPU architecture are you using?

x86_64

What Node versions, OSs and CPU architectures are you building for?

node18-win-x64

Describe the Bug

The binary exists on the C:\. The binary then attempts to read a drive on say E:\ using readdir()

ie.,

let dirents = await readdir(dir, { withFileTypes: true });

but this inaccurately returns an extra folder called snapshot on the E:\ drive. I understand there is this snapshot filesystem but I would not have expected this it override file system calls from another drive. With the current behavior, we cannot have a cli binary that can read the entire drive contents without either explicitly ignoring all drives with a root folder names snapshot that happens to actually be on that drive, or explicitly not allow reading drive contents with a snapshot directory.

Expected Behavior

Allow having readdir work for an entire drive other than the one that contains the binary.

To Reproduce

Create a binary, setup a new drive, E:\, run on windows, attempt to read the drive using readdir giving it E:\ as the readdir argument path. see that it returns a snapshot directory on E:\ which was not expected

Renari commented 1 year ago

I think this may be the same issue I was having here: https://github.com/vercel/pkg/discussions/1928

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

Renari commented 1 year ago

still relevant