[Build 462]
As has already been pointed out elsewhere, the handling of symlinks in the directory compare is a bit inconsistent. Here's how I think it should work...
As symbolic links are frequently used to e.g. select a default version among multiple available version of a file (see your local /usr/lib for example), being able to compare the actual symlink instead of the file it points to will be a really important feature for many people.
The defacto standard for most Unix tools is to have an option for either dereferencing symlinks or not. (See for example the du or cp manpages.) My proposal is that BC should follow this practice. I think should have a "dereference symbolic links" option with the following behaviour:
When "dereference symbolic links" is disabled:
When "dereference symbolic links" is enabled:
This behaviour will align well with how existing Unix tools deal with symlinks and thus with the principle of least surprise.
Ideally the "dereference symbolic links" option should be easily accessible on the toolbar.
As has already been pointed out elsewhere, the handling of symlinks in the directory compare is a bit inconsistent. Here's how I think it should work...
As symbolic links are frequently used to e.g. select a default version among multiple available version of a file (see your local /usr/lib for example), being able to compare the actual symlink instead of the file it points to will be a really important feature for many people.
The defacto standard for most Unix tools is to have an option for either dereferencing symlinks or not. (See for example the du or cp manpages.) My proposal is that BC should follow this practice. I think should have a "dereference symbolic links" option with the following behaviour:
When "dereference symbolic links" is disabled:
Directory compare uses lstat() to get the meta data of the symlink and file compare uses readlink() to show where the symlink is pointing.
Editing the symlink is basically equivalent of editing a one-line text file, except the contents are written back to the link with the symlink() call instead of open()/write().
Editing the symlink is basically equivalent of editing a one-line text file, except the contents are written back to the link with the symlink() call instead of open()/write().
When "dereference symbolic links" is enabled:
Directory compare uses stat() to get the meta data of the target file and file compare uses open()/read() to show the content of the target file.
Editing a dereferenced symilnk really edits the target file of the symlink and saving the file will actually save the target file and retain the symlink. I.e. editing and saving will not turn the symlink into a real file.
Editing a dereferenced symilnk really edits the target file of the symlink and saving the file will actually save the target file and retain the symlink. I.e. editing and saving will not turn the symlink into a real file.
This behaviour will align well with how existing Unix tools deal with symlinks and thus with the principle of least surprise.
Ideally the "dereference symbolic links" option should be easily accessible on the toolbar.
Comment