
BTW Marc there are no "hard" or "soft" symlinks. Symlinks are symbolic links, which is a file that just has the path to another file in it. While it "makes sense" to "just copy it," I think that could lead to a bunch of unexpected and undesirable behavior. E.g. I am copying a symlink that points to ~/bin/some_program to another place... Should the home directory be expanded, or should it use the home directory of whichever user is logged in? If you look at the 'alternatives' functionality in modern Linux, you have these chains of symlinks to choose the right program for 'editor' for instance, should it copy just the first symlink so that 'update-alternatives' changes propogate, or do you want any updates to be thrown away? I think we could come up with a pretty big matrix of behavior here, especially when we start getting into relative directories, and honestly I'm not confident that even the command line tools allow you to be "completely flexible" with how you handle symlinks.
Hard links, however, are a different beast entirely and they bring up an interesting question to me. One could argue that the target of the hard link should be opened and overwritten, so that all references to that file get changed, however I think it'd be much easier to argue that the file target should just be "unlinked" and then recreated, which would mean that the formerly shared hard links would point to the old file while the "synchronized" one is now sync'ed to the data you were copying but different.
"Follow links" does exactly what I want but what I use BC for, likely in excess of 99% of the time I open it, is to compare files in source control. I want to compare an old version of a file that's now in the /tmp directory to the version that's on-disk, but the file tree is recreated in /tmp as well using symlinks so that I can edit the "current" side as necessary. I understand and accept that if folks use it for synchronization that it may not work right; for syncing large datasets I tend to use rsync or robocopy depending on platform since I want to set up the sync process once in a script and then anyone can fire it off. (I realize that I can do this in BC but this is for environments where I can't just install and license this software however I want.)
Leave a comment: