[RFC][PATCH] Change to buffer lookup for given temporary files

Enrico Forestieri forenr at lyx.org
Sun Feb 23 12:01:55 UTC 2020


On Sun, Feb 23, 2020 at 12:20:16PM +0100, Stephan Witt wrote:
> Am 23.02.2020 um 00:27 schrieb Enrico Forestieri <forenr at lyx.org>:
> > 
> > On Thu, Feb 20, 2020 at 08:24:41AM +0100, Enrico Forestieri wrote:
> >> On Wed, Feb 19, 2020 at 10:33:45PM +0100, Stephan Witt wrote:
> >>> 
> >>> What I wonder: there are the Qt elements used. Why don’t we rely
> >>> on the services of QFileInfo class? E.g. canonicalFilePath() and
> >>> friends? Are there historical reasons only?
> >> 
> >> Yes, at the time it was not possible using Qt in src/support.
> > 
> > Hmmm. That does not seem to be the only reason. I now checked
> > QFileInfo::canonicalFilePath() and it does not work on Windows.
> > I created a junction but it is not resolved.
> 
> That’s a strong argument to not rely on Qt completely.
> 
> IMO, the documentation of it promise to do it better.
> 
> https://doc.qt.io/qt-5/qfileinfo.html#canonicalFilePath
> 
> "Returns the canonical path including the file name, i.e. an absolute
>  path without symbolic links or redundant "." or ".." elements."

Just for correctness, the above statement is true, because it only
speaks about symbolic links, which are actually resolved.

The point is that real symbolic links can only be created with
administrator provileges while junctions can be created by everyone.
So, technically speaking, they tell the truth, but not the whole truth.
Perhaps that's the reason they call the method canonicalFilePath()
rather than realPath().

However, there's another problem with real symlinks. If they point to
a directory and are the last component of a path, they are not recognized
as directories. This problem does not occur with junctions.

-- 
Enrico


More information about the lyx-devel mailing list