How to test if a file is a symbolic link?

Ben Finney ben+python at benfinney.id.au
Thu Oct 29 00:03:28 EDT 2009


Peng Yu <pengyu.ut at gmail.com> writes:

> 'symbolic_link' is a symbolic link in the current directory. I run
> 'python main.py', but it does not return me anything. I want to check
> if a file is a symbolic link.

You have the same access to the Python help as we do:

    >>> import os.path
    >>> help(os.path)

You have the same access to the Python documentation search facility as
we do: <URL:http://docs.python.org/library/os.path.html>.

So I'm puzzled: why do you bring so very many questions to this group
that are answered quickly by an obvious search of the standard library?

-- 
 \     “I've always wanted to be somebody, but I see now that I should |
  `\           have been more specific.” —Jane Wagner, via Lily Tomlin |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list