Symlinks created in Linux on NTFS drives (ln -s
) appear in Windows as short files with contents IntxLNK + 0x01 + (UTF-16 encoded target path)
-- probably Interix. I want to write a script to convert them, when booting in Windows, to proper NTFS symlinks, using WSL's ln
. However, I don't know how to detect short files that are really Linux symlinks, except by looking at each file's content, which would suck for a large filesystem, and would fail for plain files starting with the magic.
Why NTFS-3g still cannot create proper reparse points like the Windows mklink
or WSL2's ln -s
, even though such Windows symlinks work properly under Linux, and even though getfattr -n system.ntfs_reparse_data
can read the NTFS symlink data, is beyond me. It should really be just a simple setfattr
, though I don't know what to put in the attribute.
So, is there a way to detect symlinks created under Linux using file metadata (not contents)? I'm sure the Linux symlinks have some special attributes, because NTFS-3g can distinguish between plain files containing the InterLnkx
magic and actual symlinks containing the same magic.
Related (no answers): https://www.reddit.com/r/linuxquestions/comments/env60r/converting_linux_symlinks_to_windows_symlinks/
stat
under WSL just shows these as regular files?