develooper Front page | perl.perl5.porters | Postings from March 2001

[ID 20010309.008] glob function problems with long file names inPerl 5.6.0 on AIX 4.3

Thread Next
March 9, 2001 15:40
[ID 20010309.008] glob function problems with long file names inPerl 5.6.0 on AIX 4.3
Message ID:
   glob function returns garbage in long file names, usually a ^G (control-G) in 29th byte.

   I thought this might be a problem with a file name length limit on my installation of
   AIX 4.3. I don't know much about AIX, but I did find this, which seems to indicate that
   the file name can be up to 255 chars, and the path name up to 1024:

       $ /usr/bin/getconf NAME_MAX .
       $ /usr/bin/getconf PATH_MAX .

   The above commands were executed in the same directory from where I ran the test case
   Perl script (see below), and the path and file names that caused the error were well
   below both of these limits.

Other stuff:
   Doesn't happen with Perl 5.6.0 on AIX 4.2, or any other platform that I've used.

Test Case:

#!/usr/bin/perl -w

  foreach (glob shift) {
     print "$_\n";

Execute this script like this: 

   scriptname '*'
$ perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
    osname=aix, osvers=4.3, archname=aix
    uname='aix orbit 3 4 00201295e800 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
    cc='cc', optimize='-O', gccversion=
    cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384'
    ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -q32 -D_LARGE_FILES -qlonglong'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib -b32'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lbind -lnsl -ldbm -ldl -lld -lm -lC -lc -lcrypt -lbsd -lPW -liconv
    libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -bE:/usr/local/lib/perl5/5.6.0/aix/CORE/perl.exp'
    cccdlflags=' ', lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -b noentry -lC -lc -L/usr/local/lib'

Characteristics of this binary (from libperl): 
  Compile-time options: USE_LARGE_FILES
  Built under aix
  Compiled at Dec 11 2000 13:30:34


Steve Hart

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About