Accessing folder that has a symlink whose name differs in case is broken

Things you’d like to miss in the future...
Post Reply
kavuria
Posts: 14
Joined: 26 Jun 2019 18:03

Accessing folder that has a symlink whose name differs in case is broken

Post by kavuria »

Hello,
I just downloaded XYplorer as I needed advanced functionality and more flexibility than default Windows explorer. I loved the UI and the brief 5 mins working with it. I use a mapped drive from my Synology and I have the following on it:

Code: Select all

- Foo (regular directory)
- foo (foo -> Foo, a symlink)
Whenever I browse to, say, F:\Foo, I get an error saying - An unexpected network error occurred. F:\foo.

I am able to perfectly work with default Windows explorer, so any idea why is XYplorer defaulting to the symlink and not to the name I provided (F:\Foo)? Can this be fixed please?

Thanks in advance!
Last edited by kavuria on 27 Jun 2019 05:25, edited 1 time in total.

admin
Site Admin
Posts: 60558
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Symlink traversal from Windows broken

Post by admin »

Hello,

just to make sure: you are saying the problem is due to wrong capitalization "foo" instead of "Foo"?

What did you use to create the symlink?

Don

kavuria
Posts: 14
Joined: 26 Jun 2019 18:03

Re: Symlink traversal from Windows broken

Post by kavuria »

you are saying the problem is due to wrong capitalization "foo" instead of "Foo"
Yes, XYplorer is defaulting to lower case "foo" even though I was accessing "Foo".
What did you use to create the symlink?
The symlink is created on Linux (the Synology drive is mounted on my Linux box over NFS and exposed to Windows via CIFS).

Just FTR, the default/native Windows explorer has no issues browsing to "Foo" even when the symlink "foo" pointing to "Foo" exists ...

admin
Site Admin
Posts: 60558
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Symlink traversal from Windows broken

Post by admin »

Aha. Hmm. I mean it's a bug to create a link with wrong capitalization. But if even Explorer can handle it (how weird is that!) then XY might give it a shot as well... I'll see what I can do...

kavuria
Posts: 14
Joined: 26 Jun 2019 18:03

Re: Symlink traversal from Windows broken

Post by kavuria »

Explorer is able to browse to just regular folder ('Foo') and not the symlink ('foo'), which is understandable, but it doesn't fall back to 'foo' when I want to go to 'Foo'. It will be awesome if XY can mimic the behavior.

BTW, file case sensitivity is already supported in Windows 10 (https://devblogs.microsoft.com/commandl ... y-and-wsl/) and I want to see the day where directory case sensitivity too is respected.

jupe
Posts: 2791
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Symlink traversal from Windows broken

Post by jupe »

FYI:

Code: Select all

v19.10.0209 - 2018-08-25 15:44
    + Added a tweak to allow case-sensitive filename handling (including folder 
      names, of course). This is a radical change from conventional Windows 
      philosophy, where case is not significant in filenames: You cannot have 
      two files whose full paths only differ in case.
      The underlying file system (NTFS) however, can handle case-sensitivity 
      without problem. And why not?! On the byte level case-sensitivity is much 
      simpler to handle and faster to process than case-insensitivity.
      So here is the tweak:
        FilenamesCaseSensitive=1
      But the tweak is not enough. You also have to modify a registry key (and 
      reboot Windows afterwards). This key which by default is set 1 has to be 
      set to 0 (zero):
        HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\obcaseinsensitive=0
      Now XYplorer should be able to do this:
        - Correctly list folders that only differ in case.
        - Create new files that only differ in case.
          Not easy via GUI but by scripting, for example:
            new("neW.txT");
            new("new.TXT");
        - Create new folders that only differ in case.
          Not easy via GUI but by scripting, for example:
            new("New Folder", "dir");
            new("NEW FOLDER", "dir");
        - Correctly calculate the size of folders containing folders that only 
          differ in case.
      Notes:      
        - Windows File Explorer is totally incapable of doing any of the above.
        - FYI, in Windows 10 you can activate case-sensitive file names on a 
          directory-by-directory basis in a clumsy way using PowerShell and 
          fsutil.exe. I did not test this.
      IMPORTANT Notes:      
        - Other applications won't be able to handle this stuff neither.
        - So: You should use this tweak ONLY to get away from such a non-Windows 
          situation. To clean the scene!
        - The new tweak works from Windows XP onwards.
        - XYplorer won't be able to do much more than what's mentioned above.
          - No copying/moving to/from folders that only differ in case.
          - No renaming either, but you can, and probably *should*, rename an item 
            away from clashing names, but there will be no way back, no undo.
          - And so on. Most things won't work and you should not even try them.
          - Especially DO NOT DELETE a folder that has a sibling only differing 
            in case. You might end up with the WRONG folder GONE. And there's no 
            way back!
        - Microsoft apparently does not like to talk about this topic, so 
          reliable information is sparse and patchy.
        - Therefore: I would NOT really recommend to use this tweak unless you 
          run in a situation where for some reason you have to deal with folders 
          that only differ in case. YOU HAVE BEEN WARNED.
for instructions on how to tweak: https://www.xyplorer.com/faq-topic.php?id=tweak

kavuria
Posts: 14
Joined: 26 Jun 2019 18:03

Re: Symlink traversal from Windows broken

Post by kavuria »

Thanks for the details @jupe.

I just want to be clear that the underlying directories (either the original or symlink) are not stored on NTFS. Not sure how much it matters but the folders (directory and symlink) are only accessed via CIFS. "Following" symlinks on CIFS is not what I am after but need to just browse to the normal directory and don't want XY to get confused with a symlink that only differs in case.

Sorry if my note about file name sensitivity deviated the topic a bit ...

admin
Site Admin
Posts: 60558
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Accessing folder that has a symlink whose name differs in case is broken

Post by admin »

I need to know exactly what is going on. Is this in the folder tree or in the file list? How exactly are you opening the item (keyboard, mouse)? Do you have a screenshot?

kavuria
Posts: 14
Joined: 26 Jun 2019 18:03

Re: Accessing folder that has a symlink whose name differs in case is broken

Post by kavuria »

Is this in the folder tree or in the file list? How exactly are you opening the item (keyboard, mouse)? Do you have a screenshot?
This is in the folder tree and I am opening it using mouse. Please find the attached screenshots.

The first attachment is when accessing the symlink (foo) -- this is expected.
Screen_Shot_2019-06-27_at_3_47_48_PM.jpg
Screen_Shot_2019-06-27_at_3_47_48_PM.jpg (350.29 KiB) Viewed 1713 times
The second attachment is when accessing the folder (Foo) -- this is not expected.
Screen_Shot_2019-06-27_at_3_48_23_PM.jpg
Screen_Shot_2019-06-27_at_3_48_23_PM.jpg (332.77 KiB) Viewed 1712 times
The third attachment is when accessing the folder (Foo) from explorer
Screen_Shot_2019-06-27_at_3_55_47_PM.jpg
Screen_Shot_2019-06-27_at_3_55_47_PM.jpg (114.51 KiB) Viewed 1713 times

admin
Site Admin
Posts: 60558
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Accessing folder that has a symlink whose name differs in case is broken

Post by admin »

Thanks, that was clear.

I looked into it but, alas, case-insensitivity (foo==Foo) is just too deep in the genes of XYplorer and the Windows API. It's not impossible but the effort would be immense. Sorry, but there are too many other things I want to do first.

kavuria
Posts: 14
Joined: 26 Jun 2019 18:03

Re: Accessing folder that has a symlink whose name differs in case is broken

Post by kavuria »

Understood -- thanks for trying.

I wasn't expecting it to be easy either (I am a developer myself) but let's hope it will be available one day. Unfortunately though, this seriously limits my planned usage of the product :-(

Please do drop me an email (not sure why updates to this thread isn't sending me any email -- is there a setting somewhere I need to enable?) when you have the motivation and energy to sort this out and I will be more than happy to be a beta tester for this feature.

Take care!

admin
Site Admin
Posts: 60558
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Accessing folder that has a symlink whose name differs in case is broken

Post by admin »

Subscribe should be the default:
Attachments
2019-06-28_182317.png
2019-06-28_182317.png (20.94 KiB) Viewed 1666 times

kavuria
Posts: 14
Joined: 26 Jun 2019 18:03

Re: Accessing folder that has a symlink whose name differs in case is broken

Post by kavuria »

Thanks -- I just subscribed now. Just FYI, "subscribe" isn't turned on by default.

Post Reply