stat doesn't work!

Jeff Epler jepler at unpythonic.net
Mon Feb 9 17:40:37 CET 2004


On Mon, Feb 09, 2004 at 05:10:31PM +0100, Paulo Pinto wrote:
> I am doing an application that needs to
> know when it is manipulating symbolic links.

try os.lstat.

>>> import os
>>> from stat import *
>>> S_ISLNK(os.stat("/proc/self").st_mode)
0
>>> S_ISLNK(os.lstat("/proc/self").st_mode)
1

Jeff




More information about the Python-list mailing list