On Tue, Nov 04, 2003 at 12:45:58AM +0100, Paul Johnson wrote:
> On Mon, Nov 03, 2003 at 11:16:02PM -0000, Rob Dixon wrote:
>> Steve Grazzini wrote:
>>> The problem is that "-d $path" will return true if $path is a symlink
>>> to a directory.
>> 
>> Thanks Steve, but are you certain? I can't test it here. As far
>> as I know this behaviour isn't documented anywhere.
>
> Steve is right (just for a change).

Yeah, I try to mix a few good answers in with the nonsense...

> I don't know that this is documented anywhere specifically.  Possibly
> the closest is in perldoc -f stat (at the end on recent perls) and man
> 2 stat (on systems that have that).

It's one of those things that you can't find until you already know
about it.  The idea is that (given a UNIX-centric view of the world) 
absolutely everything follows symlinks, and only exceptions to this
rule need to be documented.

  % perldoc -f -X
         ... (This doesn't work with "-t", and you need to remember
  that lstat() and "-l" will leave values in the stat structure for 
  the symbolic link, not the real file.)

  % perldoc -f lstat

       lstat FILEHANDLE
       lstat EXPR
       lstat   Does the same thing as the "stat" function
               (including setting the special "_" filehandle) but
               stats a symbolic link instead of the file the
               symbolic link points to.

There's also some good stuff in the description of the "follow" options
for (cough!) File::Find.

-- 
Steve

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to