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

No results returned if the file is a socket #438

Closed
miniBill opened this issue Mar 30, 2024 · 1 comment · Fixed by #450
Closed

No results returned if the file is a socket #438

miniBill opened this issue Mar 30, 2024 · 1 comment · Fixed by #450

Comments

@miniBill
Copy link

Environment

  • OS Version: Linux - NixOS 23.11
  • Node.js Version: v18.19.1

Actual behavior

❯ node
Welcome to Node.js v18.19.1.
Type ".help" for more information.
> const fastglob = await import("fast-glob");
undefined
> await fastglob.default("/run/user/1000/pipewire-0")
[]
❯ ls -l /run/user/1000/pipewire-0
srw-rw-rw- 1 minibill users 0 mar  3 19:02 /run/user/1000/pipewire-0

Expected behavior

The socket file is returned in the result.

@mrmlnc
Copy link
Owner

mrmlnc commented Jul 2, 2024

Hmm. By default, the package returns only files. Literally just files:

if (this.#onlyFileFilter(entry) || this.#onlyDirectoryFilter(entry)) {
return false;
}

Other solutions (glob, wcmatch) work differently. They include everything in the results, including sockets, with the option to exclude directories.

I think we should change the current behaviour and start returning everything but directories. However, this is a major change. So, target this issue to the next major release.

Right now you can disable the onlyFiles option.

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

Successfully merging a pull request may close this issue.

2 participants