[Mingw-w64-public] How to recognize symlinks in WIN32?

David Macek david.macek.0@gmail.com
Thu Jan 15 09:11:00 GMT 2015


On 15. 1. 2015 4:11, Greg Jung wrote:
> Yes I've seen that, if my second post appeared, the symlinks created with cygwin are the ones giving me trouble.  These links are invisible to CMD.exe, by someone's
> design:
> 
> CYGWIN- created links in 
>  Directory of e:\cygwin64\lib\nox
> 
> 03/31/2014  09:39 AM    <DIR>          .
> 03/31/2014  09:39 AM    <DIR>          ..
> 07/01/2013  03:24 AM           336,710 libXpm-noX.a
> 07/01/2013  03:24 AM            43,690 libXpm-noX.dll.a
>                2 File(s)        380,400 bytes
>                2 Dir(s)  85,657,726,976 bytes free

I think these are cygwin emulated symlinks:

They are visible, just not by default. I suspect they are marked with the system attribute. Use "dir /as" to show them. You should see a small size (in order of tens of bytes).

You can instruct cygwin to create native NTFS symlinks, but due to a different design, there are some restrictions. See this: <https://cygwin.com/cygwin-ug-net/using.html#pathnames-symlinks>

> So the question becomes, "why do cygwin symlinks look different, and how can a user program detect this attribute?

I assume you could detect them using cygwin *stat calls. Maybe by compiling against cygwin headers and cygwin1.dll, or maybe by extracting the relevant code from cygwin sources (you'd have to check the relevant licenses).

-- 
David Macek

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4234 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20150115/407f5f97/attachment.p7s>


More information about the Cygwin mailing list