home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / question / 10576 < prev    next >
Encoding:
Text File  |  1992-08-31  |  1.8 KB  |  43 lines

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