Checking if the file is a symlink fails

saswat at saswat at
Fri Aug 29 10:16:26 CEST 2008

On Aug 28, 10:20 pm, Fredrik Lundh <fred... at> wrote:
> sas... at wrote:
> > Do you mean the following is deprecated ?
> >
> >>From the documentation -
> > S_ISLNK( mode)
> >     Return non-zero if the mode is from a symbolic link.
> As that page states, that's a function used to interpret a mode flag
> returned by os.stat, os.fstat, or os.lstat.  It obviously won't give you
> the result you're looking for if you use a stat function that *follows*
> symbolic links.
> </F>

Thank you Fredrick and Miles,

stat() is on the actual file and not on the symlink. That explains.


More information about the Python-list mailing list