home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!ftpbox!mothost!merlin.dev.cdx.mot.com!fendahl.dev.cdx.mot.com!mcook
- From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
- Subject: Re: got a symlink checker/chaser for crontab?
- Message-ID: <mcook.714929577@fendahl.dev.cdx.mot.com>
- Sender: news@merlin.dev.cdx.mot.com (USENET News System)
- Nntp-Posting-Host: fendahl.dev.cdx.mot.com
- Organization: Motorola Codex, Canton, Massachusetts
- References: <17544@autodesk.COM> <mcook.714926334@fendahl.dev.cdx.mot.com>
- Date: Thu, 27 Aug 1992 15:32:57 GMT
- Lines: 15
-
- I wrote:
-
- >If it's an invalid symlink, you can lstat it, but you can't stat it.
-
- >while (<>)
- >{
- chop; # <---- (oops! you'll need this!) <-----
- > next unless lstat($_);
- > next unless -l _;
- > next if stat($_);
- > print "invalid symbolic link: $_ -> ",
- > (readlink($_) || "[can't readlink: $!]"), "\n";
- >}
-
- Michael.
-