PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs323] stat failed symlink behavior
Date: Thursday, 17 Sep 2020, 14:58:01


    > Message Posted By: Unknown
    >
    > Both find and the staff solution print out error messages for when a
    > symbolic link loops back to itself and -L is specified, but print out the
    > name of the symbolic link when it points to a non-existent file and -L is
    > specified. Why does it do this instead of printing out an error in both
    > cases?

As stated in the man page for find (and posted earlier):

  -L Follow symbolic links.  When find examines or prints information about
     files, the information used shall be taken from the properties of the
     file to which the link points, not from the link itself (unless it is a
     broken symbolic link or find is unable to examine the file to which the
     link points).  ...

Thus not being able to examine the file is not an error
and does not warrant an error message.

--Stan-
PREV INDEX NEXT