link (corutils) 8.4-2: doesn't link

Eric Blake eblake@redhat.com
Mon Apr 12 14:35:00 GMT 2010


On 04/12/2010 08:15 AM, Paul Bibbings wrote:
>    14:57:37 Paul Bibbings@JIJOU
>    /cygdrive/d/Downloads/link_test $link zoo.exe zoo_link
> 
>    14:57:54 Paul Bibbings@JIJOU
>    /cygdrive/d/Downloads/link_test $ls -l
>    total 128
>    -rwxr-xr-x+ 2 Paul Bibbings None 65024 Apr 12 14:57 zoo.exe
>    -rwxr-xr-x+ 2 Paul Bibbings None 65024 Apr 12 14:57 zoo_link.exe

Umm, that decisively shows that 'link' created a hard link, working as
designed.  zoo.exe and zoo_link.exe both have a link count of 2,
compared to the typical link count of 1, so they are one and the same inode.

> 
> Can I ask first of all: does link itself use ln and should I be testing
> this?

link(1) and ln(1) both call the link(2) syscall (well, ln does that if
you didn't request symlinks).  Maybe your confusion stems from wanting a
symlink instead of a hard link?  In which case, ln(1) is the only way to
get symlinks; link(1) can _only_ create hard links.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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


More information about the Cygwin mailing list