-1

I'm stuck with a problem concerning udev symlink property.

I just set udev rules so that my TTL-232R USB device has a symlink name. However, I don't know how to extract this symlink name on my Qt project (which is actually not originally mine but someone else's). In the first place, the code gets the portname using libudev library and function udev_device_get_devnode(struct udev_device), which returns ttyUSB0. But I don't want the absolute name, just the symlink name. Unfortunately, I can't seem to find some similar function in the libudev library to get the symlink name i just set with udev rules.

Is there another library or way to do that? I'm a bit lost..

Regards,

Robin
  • 1

1 Answers1

1

try QString QFile::symLinkTarget() const

#include <QFile>
...
QFile file('/sym/link/target');
qDebug() << file.symLinkTarget();
...
Redanium
  • 879
  • 5
  • 18