From: gloesener@ISTVAX.IST.LU
Newsgroups: comp.os.vms
Subject: Re: Request help !
Date: 24 Dec 92 09:10:58 GMT
Distribution: world
Organization: The Internet

> I read a mail (I forgot the name of the sender) about recursive directory
> specification, using this command :
> 
> $ CREATE /DIR [.1]
> $ SET FILE /ENTER=[.1]2.DIR 1.DIR
> 
> The first time I access 1.DIR, I could see 2.DIR.
> Then, when I access 2.DIR, I could see another 2.DIR, and that 2.DIR seemed
> endless. Everytime I access the next one, I would always see another one,
> kind of getting deeper and deeper.
> 
> Can someone please explain to me what in happening ?
> 

What you've done is creating a link to 1.dir which is [.1]2.DIR. This means that
2.DIR is not a real directory but only a name pointing to the directory 1.DIR so
that when you enter the directory 2.DIR you are still in 1.DIR since 2.DIR 
points to 1.DIR Graphically speaking:

Seen as direvctories:

                 1.DIR <-----+
                   |         |
                   +-2.DIR---+

Physically on the disk:

    File entry 1.DIR \
                      \______> 1st block of the directory
                      /
    File entry 2.DIR /


In other words (I do NOT think that you are stuppid but my explanations might
be a bit unclear) 2.DIR is a sinonym for 1.DIR so that echa time you go to
2.DIR you are again in 1.DIR and of course you can see the directory link 2.dir
again since it is in 1.DIR (clear ?) .

> I also tried to delete the directory :
> I delete 2.DIR first, since it's lower that 1.DIR, using this command :
> ( I did this after I access 1.DIR)
> 
> $ SET PROT:O:D 2.DIR
> $ DEL 2.DIR;*
> 
> But, instead I got error message :
> insufficient privilege or file protection violation.
> 
> I'd really appreciate any help I could get ?
> Thanks in advance for any of your help.
> 

This behavior is also due to the fact that 2.DIR is a 'circular' link to 
1.DIR. This implies that changing the protection of 2.DIR also changes the
protection of 1.DIR. And you changed the protection of 2.DIR to O:D, so
1.DIR also changed to O:D. Now when you try to delete 2.DIR which is within
1.DIR VMS checks the access to all directories below the file you wand to
delete. Since you have nolonger Read or Execute access to 1.DIR VMS can not
access any file in that directory, and particulaary not 2.DIR, so that you
can not delete it. To change this You have to change the protection of 2.DIR
to O:RED but since you can not access 2.DIR because of the protection you've
set previousely you must change the protection of 1.DIR to O:RED which also
changes the protection of 2.DIR and now you can delete both directories.

                                                       Gasty Gloesener



================================================================================
                       | GGGGGG     Gasty Gloesener, 
IIIIII  SSSSSS  TTTTTT | GG         Assistant of the Institute of Technology
  II    SS        TT   | GG  GGGGGG in Luxembourg
  II    SSSSSS    TT   | GG  GG     
  II        SS    TT   | GGGGGG     Responsible for: VMS management, security,
IIIIII  SSSSSS    TT   |     GG  GG                  programming
                       |     GGGGGG                  UNIX stations management
                       |                             NETWORK management
================================================================================
e-mail: gloesener@istvax.ist.lu       | PSI: psi%0270442110::GLOESENER
        gloesener@menvax.restena.lu   |
================================================================================