A number of people have suggested handling aliases just like hard links.
There are a couple of significant differences: when I remove a hard link,
the file continues to exist. This means that any other hard links to
that file continue to be valid. This doesn't sound like much of a problem
until you consider the following:
1# ls -l "progra~1/gnuema~1/longfi~1.exe"
2# rm "Program Files/GNU Emacs/LongFileName.exe"
3# ls -l "progra~1/gnuema~1/longfi~1.exe"
Assuming the file existed in the beginning, steps 1 and 2 succeed. In
the removal of the filename, we need to remove all dentries that refer
to this file from the dcache, so we would need a way to find all dentries
for a given inode. In the above sequence, 3 should fail, but it will
succeed unless the dentries are removed.
Similarly, if the filename does not exist but the directories do,
4# ls -l "progra~1/gnuema~1/longfi~1.exe"
5# touch "Program Files/GNU Emacs/LongFileName.exe"
6# ls -l "progra~1/gnuema~1/longfi~1.exe"
4 should fail, 5 should succeed, and 6 should succeed. If the dcache
is not properly updated by removing equivalent negative dentries, 6
will fail.
- Gordon