Linux info

vasudevram vasudevram at gmail.com
Tue Jun 13 10:51:38 EDT 2006


os.system('ls -lL ' + path)
should also work. But check, I may be wrong about the L option, and am
not near a Linux system right now.

That's "lL" - a small letter l (ell) followed by a capital letter L in
the ls options above.

This way may be slower than os.path.realpath if that is implemented as
a system call, i.e.via Python ->C->Linux kernel, which it probably is.
Slower since my way given above will create a new process to run the ls
command in. Just mentioning it as another way, plus, it does have the
small benefit that it'll work the same way on any other language such
as Perl, Ruby, etc., which supports something similar to os.system().

Vasudev Ram
http://www.geocities.com/vasudevram
PDF conversion tools: http://sourceforge.net/projects/xtopdf


faulkner wrote:
> os.path.realpath
>
> TheSaint wrote:
> > Hello there,
> >
> > I still learning, but I couldn't find anything which tells me where a
> > symlink is pointing to.
> > A part of os.system('ls -l ' + path) and cutting down to the need, I haven't
> > got any specialized function.
> > 
> > F




More information about the Python-list mailing list