Skip to content

Broken behaviour in glob() #8

Open
@aflatter

Description

@aflatter

glob finds files that should not match my pattern. Interesting enough, this happens only on the first level.

xy:/tmp/foo$ ls -R .
.:
test  test.js

./test:
dir1  file1.foo  file2.foo  file5.bar

./test/dir1:
file3.foo  file4.bar

xy:/tmp/foo$ cat test.js
var sys   = require('sys'),
    async = require('asyncjs');

async.glob(__dirname + '/test/*/*.foo').toArray(function(err, files) {
  sys.puts(sys.inspect(files));               
});

xy:/tmp/foo$ node test.js
[ { path: '/tmp/foo/test/file1.foo', name: 'file1.foo' }
, { path: '/tmp/foo/test/file5.bar', name: 'file5.bar' }
, { path: '/tmp/foo/test/file2.foo', name: 'file2.foo' }
, { path: '/tmp/foo/test/dir1/file3.foo'
  , name: 'file3.foo'
  , stat: { ... }
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions