Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

GLOB_NOSPACE error when glob results in >128 files #11

papandreou opened this Issue Feb 28, 2011 · 6 comments


None yet
4 participants

papandreou commented Feb 28, 2011

To reproduce, generate 129 or more files in an empty directory:

perl -e 'for (1..129) {system "touch $_.dat";}'

And then run this snippet in the node repl:

require('glob').glob('*', function (err, fileNames) {console.log(arguments);});

On Ubuntu 10.10 and glob 2.0.5 this results in:

> { '0': 
   { message: 'GLOB_NOSPACE'
   , stack: [Getter/Setter]
   , errno: -1
, '1': '*'

From a couple of quick tests I concluded that it's the number of entries in the result that matters, not the number of candidate files.

glob 1.1.0 worked fine with any number of entries I've thrown at it so far.

timjb commented Mar 4, 2011

I get the same error on Fedora 14 regardless of the number of entries.

this is biting me too - any progress/fix for this?

of course now i read the docs i see GLOB_LIMIT should not be set and everything works as expected. Personally id say this flag shouldnt be set by default - or a big fat warning should be in the docs.


papandreou commented Jun 1, 2011

@dunkfordyce: You're right, everything works as expected for me when I supply glob.GLOB_DEFAULT & ~glob.GLOB_LIMIT as the second argument for glob. Thanks a lot for figuring that out and sharing!

+1 for not having that as the default.

timjb commented Jun 1, 2011

Btw, on my new installation of Fedora 14 it's working fine.

@isaacs isaacs closed this in e5cbb7d Jun 14, 2011


isaacs commented Sep 26, 2012

That was supposed to be for #48, whoops.

@papandreou papandreou added a commit to assetgraph/assetgraph-builder that referenced this issue Jul 12, 2014

@papandreou papandreou resolvers.file: Turn off the glob.GLOB_LIMIT flag when globbing to av…
…oid the GLOB_NOSPACE error when globbing many files.

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