[Qt-interest] Symbolic link real value?
Pau Garcia i Quiles
pgquiles at elpauer.org
Tue Jul 28 13:47:21 CEST 2009
On Tue, Jul 28, 2009 at 1:40 PM, Lukas Lipavsky<llipavsky at suse.cz> wrote:
> Hi,
>
> is there any way to get the path symlink (in linux) is pointing to? But
> I need the real value - e.g. '../../dir/file'
>
> All I found so far was QFileInfo::symLinkTarget() but it returns
> *absolute* path, which is useless for me.
>
> Is there any way to get this information from the Qt library (better
> than calling ls)?
Use QDir::relativeFilePath with the current directory (QDir::current() )
http://doc.trolltech.com/4.5/qdir.html#relativeFilePath
http://doc.trolltech.com/4.5/qdir.html#current
--
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
More information about the Qt-interest-old
mailing list