This perl monk had an idea one day to write a file system "Web Interface". Ah but there was a problem, the big bad old directory that the "file system web interface" would be managing had a whopping 93,440 files in it, and that if he wrote this perl script to load the contents of said directory into an array, that the script would have a huge memory foot print.
So Lindex decided to have his "web interface" page through the files in increments of 10 or 20. But there was a problem, Lindex didn't have a clue as to how to seek through a directory properly so that he could skip through the contents of the directory allowing him to page through the files. After much tribulation Lindex consulted the Great Tome of Perl Magick to hopefully get help from his fellow perl monks.
The breakdown...
basicly I just don't know how to
set a position on a directory filehandle so that it skips
x amount of directory listing.
Where I have:
use IO::Dir; my($dir)=IO::Dir->new('/imageproc/files/ips/fullsize/') || die; my($c,$f)=0; while($f=$dir->read() and $c<=9) { print "$c $f\n"; $c++; }
for listing a limited amount of files from a directory if I do a $dir->seek(POS) what should my POS be?
In reply to A story of a Perl Monk and Problem by lindex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |