[Interest] QFile and file shortcuts on Windows.

Mike Chinander chinander at gmail.com
Fri Sep 24 17:07:37 CEST 2021


You'll probably only have to write a little extra code and use
QFileInfo::isSymLink() <https://doc.qt.io/qt-5/qfileinfo.html#isSymLink>
and QFileInfo::symLinkTarget()
<https://doc.qt.io/qt-5/qfileinfo.html#symLinkTarget>

On Fri, Sep 24, 2021 at 10:01 AM Crocker, William <
William.Crocker at analog.com> wrote:

> Hello:
>
>
>
> My app uses Qfile:
>
>
>
> QFile in_file(file_to_read);
>
> if( in_file.open(QIODevice::ReadOnly|QIODevice::Text) ) {
>
>     ...
>
>
>
> On windows this fails (for me) for files which are actually Windows
> shortcuts to the real file.
>
> Is that a bug or am I supposed to the provide special code for shortcut
> detection and processing.
>
> I am using Qt 5.9.1 (forgive me).
>
>
>
> Thanks.
>
>
>
> ***
>
> Bill
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210924/fd79711c/attachment.html>


More information about the Interest mailing list