Re: large directory handling

2004-01-05 Thread Randal L. Schwartz
> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: Rob> You could forget about diagnosing the problem and just use Rob> my $n = unlink grep -f, glob '/test/directory/klee*'; Rob> print "$n files deleted\n"; Unless you're running an older Perl, where that'll fire off a shell to do the glob(

Re: large directory handling

2004-01-05 Thread Charles Harvey
The code below works. Thanks for the pointers on the unless loop, haven't used that before. It appears that the limitation I was running into was only on my Mac perl config; the code works fine under linux. #!/usr/bin/perl -w #open directory and load contents into hash use strict; my $dir="/te

Re: large directory handling

2004-01-05 Thread James Edward Gray II
On Jan 5, 2004, at 2:23 AM, [EMAIL PROTECTED] wrote: I tried explicitly declaring DIR as an array, but I guess handles don't do that. How do I load all of the directory into an array, or more specifically why am I only getting half? #!/usr/bin/perl use strict; use warnings; my $dir = shift; #

Re: large directory handling

2004-01-05 Thread Rob Dixon
Charles Harvey wrote: > > I have a Mac client that is grabbing pictures and writing them > to a netatalk share, and the files prefix with klee and then are > one-up serialized (not my design, I just do networking). The PC > client grabs the images via samba share and displays them. This > is par

RE: large directory handling

2004-01-05 Thread soops
> That looks very, very wrong. You're binding a scalar to > something other than a regular expression. Tell us what you > are attempting to do here. > > HTH, > > Charles K. Clarkson yeah, I agree. Here is the scenario: I have a Mac client that is grabbing pictures and writing them to a ne

Re: large directory handling

2004-01-05 Thread soops
On Jan 05 12:13, Ramprasad A Padmanabhan <[EMAIL PROTECTED]> wrote: > > > But why do you want to do it in perl ( why not rm -f $dir/* $dir/.* ) > , If you are removing all the 4000 files everytime it might make sense > to remove the entire directory and recreate it. > > > Ram > That is what

Re: large directory handling

2004-01-04 Thread Ramprasad A Padmanabhan
Charles Harvey wrote: Hello all, I am trying empty a directory with over 4000 files with a script, and do not understand why I can only delete half at a time. I am guessing that the directory handle has a size limitation?? Is there a way to load the contents into a large array or am I going a

Re: large directory handling

2004-01-04 Thread R. Joseph Newton
Charles Harvey wrote: > Hello all, > > I am trying empty a directory with over 4000 files with a script, and > do not understand why I can only delete half at a time. I am guessing > that the directory handle has a size limitation?? Is there a way to > load the contents into a large array or am

RE: large directory handling

2004-01-04 Thread Charles K. Clarkson
Charles Harvey <[EMAIL PROTECTED]> wrote: : : I am trying empty a directory with over 4000 files with a : script, and do not understand why I can only delete half : at a time. I am guessing that the directory handle has a : size limitation?? Is there a way to load the contents : into a large arra