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

Strange behavior at Windows root dir like D:/ #375

Open
crystalfp opened this issue Dec 2, 2022 · 2 comments
Open

Strange behavior at Windows root dir like D:/ #375

crystalfp opened this issue Dec 2, 2022 · 2 comments

Comments

@crystalfp
Copy link

crystalfp commented Dec 2, 2022

Environment

  • OS Version: Window 11 64bits
  • Node.js Version: 18.12.1
  • fast-glob: 3.2.12

Actual behavior

On Windows, listing the root directory of a disk like D:/* shows the content of the current working directory as it was under D:/ (see below the content of dirBad).
I had to apply the workaround in dirGood to obtain the real content.

Expected behavior

List the content of the root directory.

Steps to reproduce

  1. Externally look at the content of current working directory (e.g., D:/project/node_modules ...)
  2. Run the code below
  3. Look at dirGood. It contains the true content of the root directory (D:/./$RECYCLE.BIN)
  4. Look at dirBad. It contains the current directory content as if D:/ were equivalent to ./

Code sample

const fg = require("fast-glob")
const dirBad = fg.sync("D:/*", {onlyDirectories: true})
const dirGood = fg.sync("D:/./*", {onlyDirectories: true})
@mrmlnc
Copy link
Owner

mrmlnc commented Apr 19, 2023

gulpjs/glob-parent#63

@supanpanCn
Copy link

I had the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants