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

glob failure with large directory #776

Closed
p5pRT opened this issue Oct 23, 1999 · 4 comments
Closed

glob failure with large directory #776

p5pRT opened this issue Oct 23, 1999 · 4 comments

Comments

@p5pRT
Copy link

@p5pRT p5pRT commented Oct 23, 1999

Migrated from rt.perl.org#1701 (status was 'resolved')

Searchable as RT1701$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Oct 23, 1999

From danq@brtt.com

The following script failed for a directory with 5,251 entries​:

  #!/opt/antelope/perl/bin/perl
  @​a = glob("$ARGV[0]/*") ;
  $a = @​a ;
  print "$a entries : first is $a[0]\n" ;

The directory contains many files, all of a similar format​:

  % ls split | wc
  5251 5251 141970
  % ls split | head
  1997-189-10​:12​:36-Tue-danq
  1997-190-14​:40​:23-Wed-danq
  1997-190-14​:40​:34-Wed-danq
  1997-201-15​:57​:14-Sun-danq
  1997-201-17​:22​:40-Sun-danq
  1997-201-17​:32​:05-Sun-danq
  1997-201-18​:24​:30-Sun-danq
  1997-201-18​:28​:45-Sun-danq
  1997-201-18​:30​:41-Sun-danq
  1997-201-18​:32​:34-Sun-danq

A few filenames have a trailing "+" or "++".

Perl Info


Site configuration information for perl 5.00502:

Configured by danq at Wed Feb 17 09:19:08 MST 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
  Platform:
    osname=solaris, osvers=2.7, archname=sun4-solaris
    uname='sunos denali 5.7 generic sun4u sparc sunw,ultra-1 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags=''
    ccflags =''
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =''
    libpth=/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-KPIC', lddlflags='-G'

Locally applied patches:
    


@INC for perl 5.00502:
    /opt/antelope/perl/lib/5.00502/sun4-solaris
    /opt/antelope/perl/lib/5.00502
    /opt/antelope/perl/lib/site_perl/5.005/sun4-solaris
    /opt/antelope/perl/lib/site_perl/5.005
    .


Environment for perl 5.00502:
    HOME=/home/danq
    LANG (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/opt/java/jdk1.1.5/bin:/opt/java/JavaCC/bin:/opt/antelope/dev/bin:/usr/sbin:.:/home/danq/bin:/usr/local/sbin:/usr/local/bin:/opt/local/etc:/opt/local/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/openwin/bin:/bin:/usr/proc/bin:/usr/ucb:/opt/antelope/tcl7.4tk4.0/bin:/opt/antelope/perl/bin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Oct 23, 1999

From [Unknown Contact. See original ticket]

This was a known restriction in the release you cite. It is fixed in the
experimental release, 5.005_62. Currently, you only get the correct
behaviour if you build Perl using -DPERL_INTERNAL_GLOB. Whether that
becomes the default for the upcoming 5.6 release remains to be seen.
What we need right now is for as many people as possible to stress-test
the new built-in globbing so we have sufficient confidence in it to
make it the default.

Good luck,

--tom

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Oct 23, 1999

From [Unknown Contact. See original ticket]

"Daniel M. Quinlan" <danq@​brtt.com> wrote

The following script failed for a directory with 5,251 entries​:

\#\!/opt/antelope/perl/bin/perl
@&#8203;a = glob\("$ARGV\[0\]/\*"\) ;
$a = @&#8203;a ; 
print "$a entries : first is $a\[0\]\\n" ;

You don't say what the error is, but assuming it's the obvious one,
this is as documented in perlop.pod​:

  Furthermore, due to its current implementation of using a
  shell, the glob() routine may get "Arg list too long" errors
  (unless you've installed tcsh(1L) as /bin/csh).

The development version of Perl has its own built-in version of glob(),
so hopefully these problems should become a thing of the past.

Mike Guy

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Oct 23, 1999

From @TimToady

Tom Christiansen writes​:
: This was a known restriction in the release you cite. It is fixed in the
: experimental release, 5.005_62. Currently, you only get the correct
: behaviour if you build Perl using -DPERL_INTERNAL_GLOB.

Seems to me we'd better make it the default in beta or it won't get
properly tested. Unless we're planning for it to remain an experimental
feature till 5.7.

Larry

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

Successfully merging a pull request may close this issue.

None yet
1 participant