Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!gatech!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) Newsgroups: comp.lang.perl Subject: Re: ftw.pl (was Re: perl find) Message-ID: <1991Feb26.011953.3017@NCoast.ORG> Date: 26 Feb 91 01:19:53 GMT References: <1991Feb21.133315.25700@uvaarpa.Virginia.EDU> <1991Feb21.174657.3357@iwarp.intel.com> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KB8JRR) Followup-To: comp.lang.perl Organization: North Coast Public Access Un*x (ncoast) Lines: 43 As quoted from <1991Feb21.174657.3357@iwarp.intel.com> by merlyn@iwarp.intel.com (Randal L. Schwartz): +--------------- | In article <1991Feb21.133315.25700@uvaarpa.Virginia.EDU>, frech@mwraaa (Norman R. Frech CPLS) writes: | | Has anyone written a perl version of find? I have rewritten my backup | | to tape routines in perl and use multiple finds to generate the | | catalog. I have started working on the find subroutines and I thought | | if someone already has this code I could save some time and effort. | | I'm using ftw.pl from below every day, and beta-testing ftw2.pl. I'd | recommend ftw2.pl if it works, but can't vouch for its robustness yet. +--------------- Since the "find" on the machine at work is broken, I ended up reimplementing most of find in Perl. In fact, scratch the "most"; while I haven't finished debugging it yet, it at least attempts to support almost everything I've seen in any find --- and then some. "find.pl . -type f -eval 'chmod 644, $_'", anyone? And -mount/-xdev, -print0/-glob (the latter for csh weenies :-), -tar (after all, System V find has -cpio, may as well have equal time), -local, -nosym, -prune, etc. (Yeah, this is the one that caused me to develop that *-hack for lists of lists. Have you ever given any thought to how find has to do its thing? Especially in the presence of -o and !? I ended up parsing the arguments into a list of predicate lists, then recursively running a predicate evaluator on each file and directory found.) I will try to make an effort to get this, archive.pl/buffer.pl, and terminfo.pl over to ncoast for posting tomorrow. However, only terminfo.pl has been fully debugged (although archive.pl and buffer.pl are pretty close to being certified). In particular, find.pl hasn't had all that much testing done to it and it may be some time before I would consider it clean. I may well decide to hold on to find.pl until I have it done. BTW, what say you folks to -require? It would cause a specified file to be loaded immediately, for use in -eval. One could then define a complex routine to determine what to do to a file, -require it, and then -eval it. ++Brandon -- Me: Brandon S. Allbery VHF/UHF: KB8JRR on 220, 2m, 440 Internet: allbery@NCoast.ORG Packet: KB8JRR @ WA8BXN America OnLine: KB8JRR AMPR: KB8JRR.AmPR.ORG [44.70.4.88] uunet!usenet.ins.cwru.edu!ncoast!allbery Delphi: ALLBERY