[Info-vax] VMS Directory size. Are there limits ?
Ted Crane
tedcrane.com at gmail.com
Tue Mar 14 13:17:03 EDT 2023
OK. So 30 years have passed us by on this topic. I have no idea whether VMS ever offered a solution to this problem--my systems are still running VMS 7.0 and 7.1--but I'll offer a DCL procedure I created about 30 years ago to "compress" MAIL directories. I've written better stuff since, but this still works.
It's worth noting that the .MAI files are moved to 256 smaller directories, starting from the "end" of the main MAIL directory. The moving process is slow at first and gets much faster toward the end. The process is reversed when restoring the original MAIL directory...and proceeds much more quickly.
Side comment: It's too bad that VMS MAIL didn't implement the kind of directory structure this procedure uses. It would have made MAIL far less vulnerable to large directories.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
$ inquire SURE "Go directly to restore"
$ if SURE then goto RESTORE
$
$ if f$search("[SITE.LOGIN]MAIL2.DIR").eqs.""
$ then
$ create/directory/log [SITE.LOGIN.MAIL2]
$ else
$ dir [SITE.LOGIN.MAIL2...]/exc=*.DIR
$ inquire SURE "Is nothing in MAIL2? Continue"
$ if .not.SURE then exit
$ delete/log [SITE.LOGIN.MAIL2...]*.DIR;
$ delete/log [SITE.LOGIN.MAIL2...]*.DIR;
$ delete/log [SITE.LOGIN.MAIL2...]*.DIR;
$ endif
$
$ set noon
$
$!
$! Create the required temporary subdirectories
$! Save individual mail files from MAIL to MAIL2
$!
$ NUM = 255
$LOOP_SAVE:
$ TEXT = f$fao("!2XL",NUM)
$ show time
$ create/directory/allocation=16 [SITE.LOGIN.MAIL2.'TEXT']
$ rename/log [SITE.LOGIN.MAIL]MAIL$'TEXT'*.MAI [SITE.LOGIN.MAIL2.'TEXT']
$ NUM = NUM - 1
$ if NUM.ge.0 then goto LOOP_SAVE
$
$!
$! Save remaining stuff from MAIL to MAIL2
$!
$ rename/log [SITE.LOGIN.MAIL]*.* [SITE.LOGIN.MAIL2]
$
$RESTORE:
$
$!
$! Confirm that we should proceed backwards
$!
$ dir [SITE.LOGIN.MAIL...]
$ show time
$ inquire SURE "Is nothing in MAIL? Continue"
$
$!
$! Restore the root file first, just in case
$!
$ rename/log [SITE.LOGIN.MAIL2]MAIL.MAI; [SITE.LOGIN.MAIL]
$
$!
$! Restore individual mail files from MAIL2 to MAIL
$! Remove the temporary subdirectories
$!
$ NUM = 0
$LOOP_RESTORE:
$ TEXT = f$fao("!2XL",NUM)
$ show time
$ if f$search("[SITE.LOGIN.MAIL2]''TEXT'.DIR").nes.""
$ then
$ rename/log [SITE.LOGIN.MAIL2.'TEXT']MAIL$'TEXT'*.MAI [SITE.LOGIN.MAIL]
$ delete/log [SITE.LOGIN.MAIL2]'TEXT'.DIR;
$ endif
$ NUM = NUM + 1
$ if NUM.lt.256 then goto LOOP_RESTORE
$
$!
$! Restore remaining stuff from MAIL to MAIL2
$!
$ rename/log [SITE.LOGIN.MAIL2]*.* [SITE.LOGIN.MAIL]
$
$!
$! Remove temporary directory
$!
$ if f$search("[SITE.LOGIN.MAIL2...]*.*;*").eqs.""
$ then
$ set file/protection=(world:rwed) [SITE.LOGIN]MAIL2.dir;
$ delete/log [SITE.LOGIN]MAIL2.dir;
$ else
$ write sys$output "MAIL2 is not empty!"
$ endif
$
$ exit
More information about the Info-vax
mailing list