Note that there are some explanatory texts on larger screens.

plurals
  1. POPerl: strange behaviour of glob with files greater than 2 GB
    primarykey
    data
    text
    <p>I'm simply trying to get a list of filenames given a path with wildcard.</p> <pre class="lang-perl prettyprint-override"><code>my $path = "/foo/bar/*/*.txt"; my @file_list = glob($path); foreach $current_file (@file_list) { print "\n- $current_file"; } </code></pre> <p>Mostly this works perfectly, but if there's a file greater than 2GB, somewhere in one of the /foo/bar/* subpaths, the glob returns an empty array without any error or warning.</p> <p>If I remove the file file or add a character/bracket sequence like this:</p> <pre class="lang-perl prettyprint-override"><code>my $path = "/foo/bar/*[0-9]/*.txt"; </code></pre> <p>or</p> <pre class="lang-perl prettyprint-override"><code>my $path = "/foo/bar/*1/*.txt"; </code></pre> <p>then the glob works again.</p> <p>UPDATE:</p> <p>Here's an example (for a matter of business policy I had to mask the pathname):</p> <pre><code>[root]/foo/bar # ls -lrt drwxr-xr-x 2 root system 256 Oct 11 2006 lost+found drwxr-xr-x 2 root system 256 Dec 27 2007 abc*** drwxr-xr-x 2 root system 256 Nov 12 15:32 cde*** -rw-r--r-- 1 root system 2734193149 Nov 15 05:07 archive1.tar.gz -rw-r--r-- 1 root system 6913743 Nov 16 05:05 archive2.tar.gz drwxr-xr-x 2 root system 256 Nov 16 10:00 fgh*** [root]/foo/bar # /home/user/test.pl [root]/foo/bar # </code></pre> <p>Removing the >2GB file (or globbing with "/foo/bar/[acf]<em>/</em>" istead of "/foo/bar/<em>/</em>")</p> <pre><code>[root]/foo/bar # ls -lrt drwxr-xr-x 2 root system 256 Oct 11 2006 lost+found drwxr-xr-x 2 root system 256 Dec 27 2007 abc*** drwxr-xr-x 2 root system 256 Nov 12 15:32 cde*** -rw-r--r-- 1 root system 6913743 Nov 16 05:05 archive2.tar.gz drwxr-xr-x 2 root system 256 Nov 16 10:00 fgh*** [root]/foo/bar # /home/user/test.pl - /foo/bar/abc***/heapdump.phd.gz - /foo/bar/cde***/javacore.txt.gz - /foo/bar/fgh***/stuff.txt [root]/foo/bar # </code></pre> <p>Any suggestion?</p> <p>I'm working with: Perl 5.8.8 Aix 5.3 The filesystem is a local jfs.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload