Checking if the file is a symlink fails

saswat at gmail.com saswat at gmail.com
Fri Aug 29 10:16:26 CEST 2008


On Aug 28, 10:20 pm, Fredrik Lundh <fred... at pythonware.com> wrote:
> sas... at gmail.com wrote:
> > Do you mean the following is deprecated ?
> >http://docs.python.org/lib/module-stat.html
>
> >>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.

-Saswat



More information about the Python-list mailing list