Checking if the file is a symlink fails

Fredrik Lundh fredrik at pythonware.com
Fri Aug 29 01:20:22 EDT 2008


saswat 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>




More information about the Python-list mailing list