File links and Nautilus CD-Writer
Matthew Davidson
mjd at almatech.net.au
Wed Dec 29 04:59:31 UTC 2004
Kent Frazier wrote:
> Hard links are treated as if they were the original file. If you
> delete a hard link, it will delete the original file as well.
Just being pedantic: if you delete the _last_ hard link to the file, you
delete the file. That's why in traditional Unix programming, the
function you use to delete a file is "unlink", and in fact there's an
unlink command which you can use as a featureless equivalent to "rm".
When you create a file, you create the first hard link to it, and all
subsequent hard links are considered equal, so you can rm the file under
it's original name, but it will still exist. If you do the same with a
file you've created symlinks to, you will actually delete the file (and
create hanging symlinks).
That said, symlinks are generally preferred because, among other things,
they don't have to be on the same partition as the file they link to.
> Symbolic links, which are the most common, work similarly to Windows
> shortcuts, but not exactly the same. They are much more powerful. I
> think some apps let you choose whether to write the links or to write
> the files they refer to.
Symlinks are much more low-level than Windows shortcuts. That means
applications don't have to know what symlinks are to behave in a
sensible way. It's been a while since I used Windows, but I seem to
recall trying to open a file via a shortcut in a pre-win9x app, and
getting a small file of gibberish. That would never happen with
symlinks, because they're implemented below application level.
Most file archiving apps give you options like tar's "--dereference"
which allows you to choose which behaviour you prefer. Be careful if
you have symlinks to directories, because you could find yourself in an
infinite recursion if you've ever done something like:
$ ln -s ../ parent
> Good night.
and good afternoon.
Matthew.
--
Alma Technology
http://www.almatech.net.au
(02) 6658 1607 ... 0419 242 316
--
Make the switch to a safer, better web browsing experience:
http://www.mozilla.org/products/firefox/
http://www.switch2firefox.com/
http://www.spreadfirefox.com/
More information about the ubuntu-users
mailing list