home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!uunet.ca!geac!r-node!druid!darcy
- From: darcy@druid.uucp (D'Arcy J.M. Cain)
- Subject: Re: How to delete link when target is rm'd?
- Message-ID: <1992Aug31.140931.13182@druid.uucp>
- Date: Mon, 31 Aug 1992 14:09:31 GMT
- References: <lux.714915956@sol.UVic.CA>
- Organization: D'Arcy Cain Consulting
- Keywords: link target rm
- Lines: 31
-
- lux@sol.UVic.CA (Michael O'Henly) writes:
- > ...to which I create a symbolic link in the parent directory
- >using the command, "ln ~/dir1/dir2/file ~/dir1/file".
-
- That doesn't create a symbolic link but rather a hard link. I assume this
- was a typo and you meant to include the -s option.
-
- > What I want is to be able to "rm ~/dir1/dir2/file" and have
- >the link rm'd at the same time.
- >
- > This seems to me to be the way things should work by default.
- >After all, the thing that the link points to no longer exists so why
- >is the link not automatically rm'd with the target?
-
- I hope not. I use symbolic links even when hard links would work precisely
- because of this behaviour. With hard links it is sometimes difficult to
- manipulate files and keep the links referencing each other. By having a
- symbolic link I can remove the underlying file, replace it and the link
- still exists and refers to the new file. With hard links the link still
- references the old file.
-
- Also what happens when you unmount a local or remote drive with files
- pointed to by symbolic links? By your reasoning the link should disappear
- when the drive is unmounted. Since this happens every time you shut down
- then you would have to recreate those links on every bootup.
-
- --
- D'Arcy J.M. Cain (darcy@druid.com) |
- D'Arcy Cain Consulting | There's no government
- Toronto, Ontario, Canada | like no government!
- +1 416 424 2871 DoD#0082 |
-