[Qt-interest] Symbolic link real value?

Will Rutherdale (rutherw) rutherw at cisco.com
Tue Jul 28 16:55:03 CEST 2009


man -s 3 readlink

The standard solution in any Unix-like system is:

#include <unistd.h>

// ...

ssize_t nbytes = readlink( "location/of/my/symlink", my_buff,
my_buff_size );

-Will


> -----Original Message-----
> From: qt-interest-bounces at trolltech.com 
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Lukas Lipavsky
> Sent: 28 July 2009 07:40
> To: Qt-interest
> Subject: [Qt-interest] Symbolic link real value?
> 
> 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)?
> 
> Best regards,
> 
> -- 
> Lukas Lipavsky, QA Developer
> 
> GPG Key ID: FF55774A
> Key fingerprint = 5BEB 6AF2 9653 638E EC0E  7E73 9A11 2BC5 FF55 774A
> ---------------------------------------------------
> SUSE LINUX, s.r.o.        e-mail: llipavsky at suse.cz
> Lihovarska 1060/12        tel: +420 284 028 969
> 190 00 Prague 9           
> Czech Republic            
> ---------------------------------------------------
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 




More information about the Qt-interest-old mailing list