Subject: bug#77589: More information

From: dino chiesa <[email-masked]>
Date: Mon, 7 Apr 2025 00:16:18 +0000

This page discusses an approach to interrogating a file on Windows to determine if it is a Symlink or Junction: 

https://sourceware.org/pipermail/cygwin/2023-November/254786.html

	  HANDLE h = ...
          FILE_ATTRIBUTE_TAG_INFO at;
	  if (GetFileInformationByHandleEx (h, FileAttributeTagInfo,
					    &at, sizeof at))
	    {
	      if (at.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
	        {
		  /* Check at.ReparseTag:
		  IO_REPARSE_TAG_LX_SYMLINK: WSL symlink
		  IO_REPARSE_TAG_SYMLINK: Windows symlink
		  IO_REPARSE_TAG_MOUNT_POINT: Volume mount point
					      or directory junction
		  IO_REPARSE_TAG_APPEXECLINK: App execution alias
		  Anything else: *shrug*
		}
	    }