fast-glob icon indicating copy to clipboard operation
fast-glob copied to clipboard

Inconsistent file count

Open Nicholaiii opened this issue 1 month ago • 1 comments

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 avatar May 12 '24 11:05 Nicholaiii