Hi All, I had to dredge this message out from a few days ago... hope I don't back-track too much, but I have a MacPerl [semi] newbie question. I have been using MacPerl to write a series of file i/o utilities for our salespeoples' PowerBook 190 and 540 laptops, which are all pretty slow (the 190s are 22mhz). My utilities do things like (initially) copy our entire WWW tree onto the laptops hdd, rescan the tree to do incremental updates, Search and replace SSI tags to "rotated banners," re-rotate the "rotated" banners, or empty the trash (I added that last just as an experiment with unlink and rmdir). Also, the file copying process will automatically skip any file without an extension, or that has a "dis-allowed" extension, just in case our esteemed artists forget (AGAIN!) to remove their 5mb PhotoShop files! <grin> Anyhow, the source files, which mirror our actual Web Server, are housed on a DEC Alpha, running NT3.51. The absolute slowest part of the whole scenario is collecting lists of files from across the network, but I was looking at the routines below and wondering if this might be any than a pure Perl solution... Any thoughts from anybody? I'm currently using heavy Perl4 stuff, with a recursive decent parser that has been simplified as much as possible for efficiency. Also, I now have pretty much given up on pre-counting the files... I simply copy them as I recurse the tree, because it takes the 190s 28 minutes just to recurse all 9,000 files and stuff their names into an array... the arrays, also, get too big for memory, and I got errors on that, too. If anybody would like to check out the scripts that I have written for this, I would appreciate your comments on it, and would be happy to either post or send them to you. --Jon S. Jaques -----Original Message----- From: Chris Nandor <pudge@pobox.com> To: Terje Bless <link@tss.no> Cc: Paul DuBois <paul@snake.net>; mac-perl@iis.ee.ethz.ch <mac-perl@iis.ee.ethz.ch> Date: Wednesday, December 03, 1997 9:12 PM Subject: Re: [MacPerl] FTP client? (fwd) >At 18.09 12/3/97, Terje Bless wrote: >>Paul DuBois wrote: >>> >>>>%find . -name "*" -print > dir.out >>> >>>Actually it won't generate full pathnames, it'll generate >>>pathnames relative to the current directory. >> >>Now we`re *really* getting far afield here. :-( >>So, to get (marginally ;D) back on topic, how about using File::Find >>instead? :-) > >That's what I use with Mac::Apps::Anarchie. Works great (though you would >have to do more to create non-existing directories). Something like this: > >#!perl -w >use Mac::Apps::Anarchie; >use File::Find; > >$newdir = "PowerPudgeIII:Programming:Pudge.Net Upload"; >$uploaddir = '/web/ns-home/client/pudge'; >$ftp = Mac::Apps::Anarchie->new; >$ftp->switchapp(1); >$ftp->host('pudge.net'); >$ftp->user($user); >$ftp->pass($pass); >find(\&wanted,$newdir); > >sub wanted { > $lfile = $File::Find::name; > if (! -d $lfile) { > ($rfile = $lfile) =~ s/$newdir/$uploaddir/; > $rfile =~ s|:|/|g; > $ftp->store($lfile,$rfile,0); > } >} > >-- >Chris Nandor pudge@pobox.com http://pudge.net/ >%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10 1FF7 7F13 8180 B6B6']) >#== MacPerl: Power and Ease ==# >#== Publishing Date: Early 1998. http://www.ptf.com/macperl/ ==# > > > >***** Want to unsubscribe from this list? >***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch > ***** Want to unsubscribe from this list? ***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch