in reply to Re: soft links
in thread soft links

since Windows filesystems have no concept of a symbolic link

That's no longer strictly accurate. Win32 Symbolic links

Replies are listed 'Best First'.
Re: Re: Re: soft links
by tilly (Archbishop) on Jun 30, 2003 at 02:46 UTC
    Sorry, the link that you provide in no way contradicts what I said.

    What that article refers to is the ability to create hard links on NTFS in Windows 2000 and XP. (But not in the 9x line, or on NT.) But if you know anything about Unix filesystem concepts, hard and symbolic links are very different things.

    Hard links work by providing multiple names for the same underlying file. The name links directly to the storage space - moving or deleting one name does nothing to the others. And since it is implemented directly in the filesystem, hard links all have to be on the same partition.

    Soft links (also called symbolic links) are a kind of redirect. The filesystem remembers that what is supposed to be here is whatever happens to be there. The lookup is done at access time, by name. Therefore soft links will be messed up if you move or delete the original, but soft links have no problems crossing partitions.

    These two things look superficially similar, but their capabilities are very different. For instance many shops use carefully chosen symlinks into a source control directory to allow things to both be managed in one place and also appear where they need to in other places in the filesystem. You can't do that with hard links since the other places might be on other partitions, and you don't want to get bitten if, for instance, a file gets deleted and rewritten from scratch. (With hard links the delete destroys the connection between the two copies. With soft links it does not.)

    Therefore what you link to does not show that Windows can do soft links.

    But even if it did, I suspect that it would not work for the original question. First of all if you follow your link you will see that, CreateHardLink does not work over the network redirector. I don't have enough Windows programming experience to say for sure, but that looks suspiciously like you cannot pass that argument to mounted filesystems. And if Windows won't communicate it, there is going to be no way that Samba can implement their half.

    However we do have a good question that arises. The function you describe is exactly what you need to implement Perl's link function. Can Perl on Windows take advantage of that? If not, then it would be a good thing to add.