-
I'm accessing an Unraid share on Windows using SMB. Windows Explorer can follow symbolic links found on this share, so I know that there's not some total failure of the SMB protocol on Windows to handle symbolic links.
I can assure you this really is a symbolic link: ...and that double-clicking on the 007 folder in Explorer properly reveals the target of the link. I'm using Node.JS v18.17.1 on Windows 11. I get the same problem using Node.js in WSL, looking at the same mounted SMB share. WSL itself doesn't see the link as a link. Is this a Node.js bug? Is there some option or work-around that I'm missing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Apparently I was wrong about Explorer somehow being aware of symlinks, and being able to use them. What's going on is that, as far as Windows is concerned, or any consumer of the SMB volume, the symlink to a file IS that file, and the symlink to a directory IS that directory. It's impossible to distinguish between a link and the target to that link. Fortunately for me, the code I'm writing, while being tested on Windows, will run in a Linux environment on Docker when deployed. For testing purpose, this ugly hack helps:
I run the above command on my Unraid server to build a symlink lookup at the root of the volume. Instead of using |
Beta Was this translation helpful? Give feedback.
Apparently I was wrong about Explorer somehow being aware of symlinks, and being able to use them.
What's going on is that, as far as Windows is concerned, or any consumer of the SMB volume, the symlink to a file IS that file, and the symlink to a directory IS that directory. It's impossible to distinguish between a link and the target to that link.
Fortunately for me, the code I'm writing, while being tested on Windows, will run in a Linux environment on Docker when deployed. For testing purpose, this ugly hack helps:
find . -type l -exec echo {} \; -exec readlink {} \; > symlinks.txt
I run the above command on my Unraid server to build a symlink lookup at the root of the volume. Instead…