[LA.pm] -l returns false on broken symlinks

Ofer Nave ofer at netapt.com
Thu Feb 17 13:50:09 PST 2005


I was incorrect.  There was a mistake in my test case.  -l does, in fact, 
return true on a broken symlink.

How embarassing...

-ofer

On Wed, 16 Feb 2005, Ofer Nave wrote:

> 
> I've just discovered that the -l test operator returns false on broken 
> symlinks.  This, of course, makes perfect sense, since in the context of 
> symlinks it is known that the operator's tests apply to the symlinks 
> target, and with regards to a broken symlink, the target clearly doesn't 
> exist.  :)
> 
> However, this brings up the question: If you want to determine whether or 
> not the symlink exists, how do you?  Prerably without ugliness like system 
> calls and parsing text output.
> 
> -ofer
> 
> _______________________________________________
> Losangeles-pm mailing list
> Losangeles-pm at pm.org
> http://mail.pm.org/mailman/listinfo/losangeles-pm
> 



More information about the Losangeles-pm mailing list