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

Inconsistent file count #440

Closed
Nicholaiii opened this issue May 12, 2024 · 1 comment
Closed

Inconsistent file count #440

Nicholaiii opened this issue May 12, 2024 · 1 comment

Comments

@Nicholaiii
Copy link

Environment

  • OS Version: Windows 11 Pro 23H2
  • Node.js Version: 22.1.0

Actual behavior

When I glob a dir for files, I am getting a wildly different number of paths returned on every sequential call.

Expected behavior

fast-glob returns all the files, the same count every time.

Steps to reproduce

  1. FG a large dir
  2. Repeat
  3. Compare

Code sample

const fileTypes = [
   'flac',
   'mp3',
   'ogg',
   'wav',
   'aac',
   'm4a',
]
const glob = (path) => (cwd) => fg(path, { cwd, caseSensitiveMatch: false, onlyFiles: true })
const findTracks = glob(`**/*.{${fileTypes.join(',')}}`)
findTracks("D:/media/music").then(e=>console.log(e.length))
// 4577
findTracks("D:/media/music").then(e=>console.log(e.length))
// 4507
findTracks("D:/media/music").then(e=>console.log(e.length))
// 4545
@Nicholaiii
Copy link
Author

I think I have narrowed it down to using a SMB mount to a Linux directory that had folders with similar names but different letter-casing, causing Windows to act strangely.

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

No branches or pull requests

1 participant