Ln can't hard link into named directory

Eric Blake eblake@redhat.com
Sat Oct 20 19:23:00 GMT 2012

On 10/20/2012 12:22 PM, Lawrence Mayer wrote:
> Ln can't hard link into named directory.
> e.g.
> Ln ... TARGET... DIRECTORY (3rd form)
> and
> ln ... -t DIRECTORY TARGET...  (4th form)
> both fail when DIRECTORY is named (but appear to work when DIRECTORY = '.' (current directory))
> returning error message
> 'ln: Cannot create a file when that file already exists.' when TARGET is named file
> or
> 'ln: The filename, directory name, or volume label syntax is incorrect.' when TARGET is '*' (wildcard).

Please show us the actual command line you typed, rather than a
description of it; even better, starting from an empty directory, show
us a sequence of mkdir and touch commands that will get us into the same
state to reproduce the message you are complaining about.  However, I
suspect that this is not a bug in ln, but a misunderstanding on your
part.  Cygwin, like Linux, prohibits the creation of hard links to a
directory, and POSIX permits this restriction.  Just because Solaris
chose to allow hard links to a directory does not make it a good idea.

Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20121020/b2e71606/attachment.sig>

More information about the Cygwin mailing list