home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / vms / 19864 < prev    next >
Encoding:
Internet Message Format  |  1992-12-24  |  3.5 KB

  1. Path: sparky!uunet!wupost!spool.mu.edu!agate!ucbvax!lrw.com!leichter
  2. From: leichter@lrw.com (Jerry Leichter)
  3. Newsgroups: comp.os.vms
  4. Subject: RE: Request help !
  5. Message-ID: <9212242318.AA04439@uu3.psi.com>
  6. Date: 24 Dec 92 21:54:06 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: world
  9. Organization: The Internet
  10. Lines: 74
  11.  
  12.  
  13.     Hi, everybody !
  14.  
  15.     I read a mail (I forgot the name of the sender) about recursive
  16.     directory specification, using this command :
  17.  
  18.     $ CREATE /DIR [.1]
  19.     $ SET FILE /ENTER=[.1]2.DIR 1.DIR
  20.  
  21.     The first time I access 1.DIR, I could see 2.DIR.  Then, when I access
  22.     2.DIR, I could see another 2.DIR, and that 2.DIR seemed endless.
  23.     Everytime I access the next one, I would always see another one, kind
  24.     of getting deeper and deeper.
  25.  
  26.     Can someone please explain to me what in happening ?
  27.  
  28.     I also tried to delete the directory :  I delete 2.DIR first, since
  29.     it's lower that 1.DIR, using this command : ( I did this after I
  30.     access 1.DIR)
  31.  
  32.     $ SET PROT:O:D 2.DIR
  33.     $ DEL 2.DIR;*
  34.  
  35.     But, instead I got error message :
  36.     insufficient privilege or file protection violation.
  37.  
  38. Ever hear of the sorcerer's apprentice?  If you play games with features of
  39. VMS (or any system) that you don't understand, be prepared to be bitten!
  40.  
  41. As Gasty Gloesener pointed out in a previous message, what you have actually
  42. done is created loop in the directory tree:  There is a single directory with
  43. two names, 1.DIR and 2.DIR.  The 2.DIR directory appears within the 1.DIR
  44. directory.  If you want an interesting display, try doing:
  45.  
  46.     $ DIRECT [.1...]
  47.  
  48. Note how you see the same thing at deeper and deeper levels.  Note also that
  49. the display stops after a while:  RMS limits you to 8 levels of directory
  50. nesting, so even though there is a loop in the directory structure, it cuts
  51. things off after going down 8 levels.
  52.  
  53. Every file on the system, including a directory file, has a unique internal
  54. identification known as a File ID, or FID for short.  If you try the same
  55. directory command with the /FILE_ID qualifier, you will see that unique
  56. identification number (it's conventionally displayed as three numbers in
  57. parentheses, like (227,117,0)), which will be the same at every level in
  58. the output, indicating that you are seeing the same file over and over again.
  59.  
  60. Mr. Gloesener also explained why you got the particular error message you did:
  61. When you changed the protection on the 2.DIR directory, you also automatically
  62. changed it on the 1.DIR directory, since they are the SAME directory, under
  63. different names.  So now you've denied yourself READ access to 1.DIR, and can
  64. no longer get to 2.DIR.  You can avoid that, as he suggested, but changing the
  65. protection to O:RWED.
  66.  
  67. However, if you do that and try to delete 1.DIR, you'll STILL fail, with a
  68. different error message.  This time, you'll get:  "Directory file is not
  69. empty".  RMS won't let you delete a directory that contains files.  Normally,
  70. you could just delete everything from the directory - but the only thing "in"
  71. [.1] is 2.DIR, which is the same file - so deleting IT fails with yet another
  72. error message:  "File access conflict" (which, BTW, I can't exactly explain,
  73. though it makes sense in broad terms).
  74.  
  75. There IS a solution:  You have to "undo" the synonym you created with
  76. SET FILE/ENTER.  The "reverse" of this command is SET FILE/REMOVE.  If you
  77. do:
  78.  
  79.     $ SET FILE/REMOVE [.1]2.DIR;
  80.  
  81. you'll find that you are back to where you where after you first created [.1],
  82. with an empty directory.  If the protection allows it, you can now delete it
  83. with no further problems.
  84.                             -- Jerry
  85.  
  86.