home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!fmrco!fmrco!asherman
- From: asherman@laser.fmrco.com (Aaron Sherman)
- Subject: Re: got a symlink checker/chaser for crontab?
- In-Reply-To: dansmith@Autodesk.COM's message of 27 Aug 92 00:43:12 GMT
- Message-ID: <ASHERMAN.92Aug27170323@laser.fmrco.com>
- Sender: news@fmrco.uucp
- Organization: I-Kinetics, 19 Bishop-Allen Dr., Cambridge, MA
- References: <17544@autodesk.COM>
- Date: Thu, 27 Aug 1992 22:03:23 GMT
- Lines: 30
-
-
- I just posted (mere days ago) an article titled:
-
- "Re: Filename expansion ("~user")"
- (ID: <ASHERMAN.92Aug22193046@laser.fmrco.com>)
-
- This contained a library routine for perl that did lots of file-name
- resolution like that.
-
- But, for your purposes, this will work:
-
- #!/usr/local/bin/perl -- # Or wherever...
- # WARNING: UNTESTED!!!
-
- open(P,'find / -type -l -print 2> /dev/null |') ||
- die("Cannot fork: $!\n");
-
- while(<P>)
- {
- print "No such file: ", readlink($_), " pointed to by: ",
- $_, "\n" if (! -e $_);
- }
- close(P); # Kill damuda
-
- exit(0);
- --
- --------
- Disclaimer: I am solely responsible for the content of this message.
- The views expressed here may not be the views of I-Kinetics, Fidelity,
- any of the Fidelity-owned corporations or my mother.
-