utility to update existing cygwin symlinks to native format? (was Re: native symlink)

Charles Wilson cygwin@cwilson.fastmail.fm
Tue Apr 30 00:44:00 GMT 2013

On 4/29/2013 8:34 PM, James Gregurich wrote:
> On Apr 29, 2013, at 5:25 PM, Christopher Faylor  wrote:
>> If you're asking "Did Corinna write a utility to do this?" the answer
>> is extremely likely to be "No" since she would have mentioned it if
>> she had.
>> If you're asking "Will Corinna write a utility to do this?" I suspect
>> that the answer is likely also "No".
> Unfortunately, the utility is a necessity for practical use of the native symlink feature.  I'm not opposed to writing it if I can get the necessary public function exposed in path.cc.  I suppose the discussion can be tabled until she gets back. At a bare minimum, I'd need a function that returns the format of the symlink in question. With such a function, I could just delete the link and recreate it if the format is not native.

The winln program is part of the most recent cygutils package (1.4.12). 
It was written by Daniel Colascione...

        winln - create a Windows symbolic link

        winln [-svfdFA] TARGET LINKNAME
        winln [-svfdFA] TARGET
        winln [-svfdFA] TARGET... DIRECTORY
        winln [-svfdFA] -t DIRECTORY TARGET...

        winln  is  a  drop-in  replacement for ln(1), the difference 
being that
        winln creates Windows symbolic links instead of Cygwin ones. 
Note that
        Windows	has  two  kinds	 of  symbolic  links: file links and 
        links.  winln automatically chooses the correct type of link 
when  the
        target  exists,	but  if	 the  target  does  not exist, you may 
want to
        explicitly specify the kind of link to create.  Links  to 
        targets default to file links.

        -s, --symbolic
	      Create  a symbolic (as opposed to hard) link.  For compatibility
	      with ln(1), creating hard links is the default.

        -v, --verbose
	      Print to standard output the names of links created.

        -f, --force
	      Replace existing destination file.

        -d, --directory
	      Create a directory symbolic link.

        -F, --file
	      Create a file symbolic link.

        -A, --auto
	      Automatically determine the type of symbolic link to create.  If
	      the  target  exists  and is a directory, create a directory sym‐
	      bolic link.  Otherwise, create a file symbolic link.

        -t, --target-directory
	      Treat DIRECTORY as the directory in which to create links	 based
	      on the remaining arguments.

        -T, --no-target-directory
	      Treat LINKNAME as a normal file always.

        -h, --help
	      Show brief help message.

	      Display version information

        winln  does not implement the following command line arguments 
from GNU
        -b, --backup, -i, --interactive, -L, --logical,	-n, 
        -P, --physical

More information about the Cygwin-developers mailing list