[TC 10.0 x64] can not open *.jpg with xnview in TotalCommander on some directories

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
armips
Junior Member
Junior Member
Posts: 5
Joined: 2022-05-07, 03:03 UTC

[TC 10.0 x64] can not open *.jpg with xnview in TotalCommander on some directories

Post by *armips »

Steps to reproduce:
1. install xnviewMP freeware from https://www.xnview.com/en/xnviewmp/#downloads
2. Put a jpg file such as 1.jpg in c:\Documents and Settings\xxx\Desktop\1.jpg
3. Browse with TC to find the 1.jpg
4. Double left click on 1.jpg or right click 1.jpg to select open with Xnview MP in TC, both operations shows "File not find". But it should be OK when I use windows explorer to do the same things.
5. This seems only happenning in the special directories such as "c:\Documents and Settings\xxx\Desktop\ ". It is OK in other dirs such as "d:\tmp\ ", maybe it is a bug.
User avatar
white
Power Member
Power Member
Posts: 4595
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 10.0 x64] can not open *.jpg with xnview in TotalCommander on some directories

Post by *white »

Does it fail with dirs or file name with a space in it?
Perhaps your association with jpg files is not correct.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [TC 10.0 x64] can not open *.jpg with xnview in TotalCommander on some directories

Post by *Dalai »

On Windows systems after XP, "Documents and Settings" is a symlink to C:\Users (or %SystemDrive%\Users). If the user is not allowed to read the symlink's target, errors such as the one described can occur. Try with a path with spaces that is not linking to any directory. If that works, the permissions on the symlink were probably somehow altered.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
armips
Junior Member
Junior Member
Posts: 5
Joined: 2022-05-07, 03:03 UTC

Re: [TC 10.0 x64] can not open *.jpg with xnview in TotalCommander on some directories

Post by *armips »

white wrote: 2022-05-07, 09:32 UTC Does it fail with dirs or file name with a space in it?
Perhaps your association with jpg files is not correct.
I have tested, TC works well with other dirs or file names with a space.
The association with jpg is sure be OK and so about the permissions, because I can open it by double click with windows exploer in the same dirs as "c:\Documents and Settings\xxx\Desktop\1.jpg", but TC fails.
armips
Junior Member
Junior Member
Posts: 5
Joined: 2022-05-07, 03:03 UTC

Re: [TC 10.0 x64] can not open *.jpg with xnview in TotalCommander on some directories

Post by *armips »

Dalai wrote: 2022-05-07, 12:10 UTC On Windows systems after XP, "Documents and Settings" is a symlink to C:\Users (or %SystemDrive%\Users). If the user is not allowed to read the symlink's target, errors such as the one described can occur. Try with a path with spaces that is not linking to any directory. If that works, the permissions on the symlink were probably somehow altered.

Regards
Dalai
My os is windows 10, I know the "c:\Documents and Settings\xxx\Desktop\pic\1.jpg" is a symlink with "c:\Users\wuj\Desktop\1.jpg". So I tried to make TC left window show with "c:\Documents and Settings\xxx\Desktop\pic\1.jpg" while the right window show with "c:\Users\wuj\Desktop\1.jpg".
When I try to double click the two 1.jpg file on both windows, the left windows pop up a message box of xnview says "file not found", the right window works well.
Maybe it is a bug of xnview, but when I do the same thing with windows explorer, both work well.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [TC 10.0 x64] can not open *.jpg with xnview in TotalCommander on some directories

Post by *Dalai »

Check the symlink's permissions whether or not they allow to read its target. If you have another system or virtual machine, you can compare those permissions with it.

Tip: If you're familiar with Sysinternals Process Monitor, you can use that to find out what's wrong. Set the filter to the executable of the program showing the error message.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
armips
Junior Member
Junior Member
Posts: 5
Joined: 2022-05-07, 03:03 UTC

Re: [TC 10.0 x64] can not open *.jpg with xnview in TotalCommander on some directories

Post by *armips »

Dalai wrote: 2022-05-08, 12:33 UTC Check the symlink's permissions whether or not they allow to read its target. If you have another system or virtual machine, you can compare those permissions with it.

Tip: If you're familiar with Sysinternals Process Monitor, you can use that to find out what's wrong. Set the filter to the executable of the program showing the error message.

Regards
Dalai
Sorry I do not know how to check the symlink's permission, I checked the permissions of ""c:\Documents and Settings\xxx\Desktop\pic\1.jpg" , the current user has the full controll of the file.
I use Process Monitor to compared the difference of how TC and windows explorer open the file. I found that TC Process Start with a Command Line such as "D:\Softwares\XnViewMP\xnviewmp.exe" "C:\Documents and Settings\xxx\Desktop\1.jpg", while windows explorer Pcocess Start with a Command Line "D:\Softwares\XnViewMP\xnviewmp.exe" "C:\Users\xxx\Desktop\1.jpg". That means windows explorer replace the symlink with the real path of the file,so it works OK.
I also tried to execute "D:\Softwares\XnViewMP\xnviewmp.exe" "C:\Documents and Settings\xxx\Desktop\1.jpg" in a command window , it also complains "file not found" same as in TC. While it is OK to exec "D:\Softwares\XnViewMP\xnviewmp.exe" "C:\Users\xxx\Desktop\1.jpg" in a command window.

So that is the key reason for the problerm, TC did not replace the the symlink with real path just like what windows explorer does, this would cause some apps can not open the target file correctlly such as xnview. But it is hard to say this is a bug of TC or xnview.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [TC 10.0 x64] can not open *.jpg with xnview in TotalCommander on some directories

Post by *Dalai »

The permissions of "Documents and Settings" can be found on the "Security" tab in its properties. The actual file's permissions are irrelevant. Programs can't replace the symlink with the symlink's target if they're not allowed to read where the symlink points to, hence they say "File not found". But it's not a program's responsibility to read the target of junctions and symlinks anyway, because these NTFS features are completely transparent, meaning that even software that doesn't know anything about such file-sytem things, should work just fine. And TC is known to call ShellExecuteEx function to launch programs.

If my assumption of being not able to read the symlink's target is correct, this is no bug at all, neither in TC nor XnView.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Re: [TC 10.0 x64] can not open *.jpg with xnview in TotalCommander on some directories

Post by *HolgerK »

I thought 15 years after MicroSoft switched with Vista to a new scheme for application data and program data location, that the very last user would not stay with pre vista Folders in W10/11.... :-(
https://docs.microsoft.com/en-us/windows/win32/vss/junction-points wrote:For example, user data that was previously stored in the %SystemDrive%\Documents and Settings directory is now stored in the %SystemDrive%\Users directory. For backward compatibility, the old locations have junction points that point to the new locations. For example, C:\Documents and Settings is now a junction point that points to C:\Users. Backup applications must be capable of backing up and restoring junction points.
These Folders ("Documents and Settings" and localized versions like "Dokumente und Einstellung" in german XP)
are replaced with new locations.
MS created these junction only for old application with hard coded paths (that's why these Folders have hidden system attribute and ACLs to deny Read access to everyone)

Even W10 Explorer does not show this folder and does not allow to open this folder (eg. with <F4> "C:\Documents and Settings").
And btw. TC shows this folder, but when you open this folder you are redirected to the correct path "C:\Users"...

One flaw in Explorer (and TC) is when you enter something like "C:\Documents and Settings\<USERNAME>\Desktop" as path.
Neither Explorer nor TC redirects this to "C:\User\<USERNAME>\Desktop".
Staying in this path, both (TC and Explorer!!!) can't open a jpg with XnViewMP (but both can open a jpg with XnView Classic!!)
-> XnViewMP seems to be to modern for these dusty pre Vista MS-compatibility hacks...

2armips
You should either get familiar with these new folder structure (Junction Points in Vista) or fill in a bug report for xnViewMp (MP - Bug reports).

Regards
Holger
Make our planet great again
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [TC 10.0 x64] can not open *.jpg with xnview in TotalCommander on some directories

Post by *Dalai »

HolgerK wrote: 2022-05-08, 21:32 UTC[...] and ACLs to deny Read access to everyone)
They deny only "List folder/Read data" in the directory itself, but they allow to traverse the folder's contents explicitely - which should be enough to reach subdirectories and thus the file in question.

Simple example for CMD

Code: Select all

dir "C:\Documents and Settings"
dir "C:\Documents and Settings\%UserName%"
dir C:\Users
dir C:\Users\%UserName%
Only the first one will fail, the other ones work just fine.

Staying in this path, both (TC and Explorer!!!) can't open a jpg with XnViewMP (but both can open a jpg with XnView Classic!!)
Well, armips claims that it works for him/her in Explorer.

And, you're right that this is a junction, I was on the wrong path (literally ;)).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
armips
Junior Member
Junior Member
Posts: 5
Joined: 2022-05-07, 03:03 UTC

Re: [TC 10.0 x64] can not open *.jpg with xnview in TotalCommander on some directories

Post by *armips »

After I changed the permissions of "Documents and Settings" to allow operations of everyone, TC works well with XnviewMP, but I donot know it is OK for me to do that.
I also tried that XnviewMP can not open "C:\Documents and Settings\xxx\Desktop\1.jpg", but meanwhile notepad.exe can open ""C:\Documents and Settings\xxx\Desktop\1.txt". So I think it is a bug of XnviewMP
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 10.0 x64] can not open *.jpg with xnview in TotalCommander on some directories

Post by *ghisler(Author) »

Moderator message

Since this doesn't seem to be a bug in TC itself, I will move this thread to "will not be changed"
Author of Total Commander
https://www.ghisler.com
Post Reply