storing symlink in extended attribute (on ntfs)

Christopher Faylor
Fri May 11 11:28:00 GMT 2001

On Thu, May 10, 2001 at 08:15:21PM +0400, egor duda wrote:
>Thursday, 10 May, 2001 egor duda wrote:
>ed>   i've modified cygwin slightly to store symlink value in shortcut's
>ed> extended attribute, and to try to get it from there. my (rough)
>ed> benchmarking shows 30%-50% speedup in symlink resolution code.
>ed> the patch is only proof-of-concept. of course, if will be cleaned up
>ed> (work only on ntfs, better error checking, etc.) if we decide we need
>ed> such functionality in cygwin. 
>here's ready-to-go patch.
>2001-05-10  Egor Duda  <>
>        * security.h (NTWriteEA): Change prototype.
>        * (NTReadEA): Don't check for global ntea setting, now
>        it's caller responsibility.
>        (NTWriteEA): Ditto.
>        * (symlink): If symlink is created on NTFS, store its
>        value in EA.
>        (symlink_info::check): Get symlink value from EA.
>        * path.h: Define SYMLINK_EA_NAME
>        * (get_file_attribute): Read attribute from EA only 
>        if 'ntea' is enabled.
>        (set_file_attribute): Ditto.

This looks ok.  I'm a little concerned about adding YA way to set symlinks,

As a specific comment, I wonder if it would just make sense to store volume
information in the path_conv class to avoid going through the duplicate efforts
in symlink.

I'd also prefer that the stuff in symlink and symlink_info::check be put into
separate functions.


More information about the Cygwin-patches mailing list