text stringlengths 0 1.99k |
|---|
supports the use of symbols for directory names. |
Like with PC-DOS, VMS directories and sub-directories are tree |
structured. The system root directory for your disk has the |
name [000000], and in it are the names of all the sub-directories |
for your disk. The directories for an imaginary user, CS335825305, |
would be located like this: |
System Root Directory: |
[000000] |
. . . . |
CS3358 Directories: . . . . |
. . *. . |
... [CS3358251] [CS3358252] [CS3358253] [CS3358254] ... |
. . . |
CS3358253 Directories: . . . |
. *. . |
... [CS3358253.04HOPE] [CS3358253.05JONES] [CS3358253.06KEY] ... |
. . |
CS335825305 Directories: . . |
*. *. |
[CS3358253.05JONES.MAIL] [CS3358253.05JONES.BULL] |
If you're not using sub-directories, but want to, you can |
create them with the CREATE command: |
CREATE/DIR [.sub_name] |
VMS allows directories to be seven or eight levels deep, but |
one or two levels is enough for most users. |
VMS also allows the symbols < and > to be used instead of |
[ and ], to specify directory names. CD fully supports this. |
Code for CD.COM |
>>>>>>>>>>>>>>> |
$! CD.COM v6.09 |
$! The Ultimate Change Directory Command. |
$! |
$ hdir = f$trnlnm("SYS$LOGIN") ! Home Directory |
$ ndir = f$edit(p1,"UPCASE") ! New Directory |
$ odir = f$environment("DEFAULT") ! Old Directory |
$ prompton = (f$edit(f$trnlnm("SYS$PROMPT"),"UPCASE") .eqs. "ON") |
$! |
$ if (ndir .eqs. "") then goto DISPLAY ! No Dir |
$ if (ndir .eqs. "*") then goto DIRSEARCH ! Search for Dirs |
$ if (ndir .eqs. "?") then goto HELP ! Instructions |
$! |
$ PARSE: |
$ length = f$length(ndir) ! Fix up ndir |
$ if (f$location("@",ndir) .eq. 0) .or. - |
(f$location("$",ndir) .eq. 0) then ndir = f$extract(1, length - 1, ndir) |
$ right = f$location("]",ndir) + 1 |
$ if (right .gt. length) then right = f$location(">", ndir) |
$ if (right .le. length) then ndir = f$extract(0, right, ndir) |
$! |
$ if (f$trnlnm(ndir) .eqs. "") then goto CASESYM ! Not Logical Name |
$ ndir = f$trnlnm(ndir) ! Logical Name |
$ goto PARSE |
$! |
$ CASESYM: |
$ if ("''&ndir'" .eqs. "") then goto CASE0 ! Not Symbol |
$ ndir = 'ndir' ! Symbol |
$ goto PARSE |
$! |
$ CASE0: |
$ len_ndir = f$length(ndir) ! Regular Dir |
$ if (f$location("[", ndir) .lt. len_ndir) .or. - |
(f$location("<", ndir) .lt. len_ndir) then goto SETDIR |
$! |
$ CASE1: ! Home Dir |
$ if ((ndir .nes. "HOME") .and. (ndir .nes. "\")) then goto CASE2 |
$ ndir = hdir |
$ goto SETDIR |
$! |
$ CASE2: ! . .. .dir |
$ if (f$location(".", ndir) .nes. 0) then goto CASE3 |
$ if (ndir .eqs. "..") then ndir = "-" |
$ if (f$extract(0, 2, ndir) .eqs. "..") - |
then ndir = "-" + f$extract(1, len_ndir - 1, ndir) |
$ ndir = "[" + ndir + "]" |
$ if (ndir .eqs. "[.]") then ndir = odir |
$ goto SETDIR |
$! |
$ CASE3: ! : |
$ if (f$location(":", ndir) .ge. len_ndir) then goto CASE4 |
$ left = f$location(":", ndir) + 1 |
$ symbol = f$extract(left, 1, ndir) |
$ if (symbol .eqs. ":") then goto CASE3B ! :: Node |
$ if ((symbol .eqs. "[") .or. (symbol .eqs. "<")) then goto SETDIR |
$ ndir = f$extract(0, left, ndir) + "[" - |
+ f$extract(left, len_ndir - left+1, ndir) + "]" |
$ goto SETDIR |
$! |
$ CASE3B: ! NODE::nothing |
$ if (f$length(ndir)-1 .gt. left) then goto CASE3C |
$ ndir = ndir + "[000000]" |
$ goto SETDIR |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.