A Clean Directory
is a
Happy Directory


Are you frustrated with your root directory, because it contains all sorts of files that end with the extension .MAI or a prefaced by DECW$? You don't know what they are for, and you are afraid to delete them, or worse you have deleted them and now you've lost your workstation windows setup or mail messages. Well here are some tips to help you remove unwanted files from your root directory. They allow you to specify alternate locations for many files that VMS uses to keep your preferences, messages and work files.


Hiding those unwanted MAIL (.MAI) files:

This problem is the easiest of all to fix. The VMS MAIL utility does all of the work for you. By default VMS MAIL puts all of your mail files in your root directory. Hence your root directory can get all cluttered up with files that end in the extension .MAI with strange long filenames.

All you need to do is select the name of a sub directory you wish to put all the MAIL files into. For example, if you want to put all the mail files in a sub directory to your root directory called VMS MAIL, then all you need to do is enter in these commands from a terminal window :

$MAIL
MAIL>
SET FILE [.VMS MAIL]
MAIL>
EXIT

Poof! The sub directory has been created and all the files have been moved, and the mail system has been properly notified. WOW! Wasn't that simple? Now if you still have .MAI files in your root directory, they can be safely deleted.


Hiding those unsightly Dec Windows (DECW$) preference files:

While not as easy as the previous problem, this one is not too tough to do either. First you must choose the name of a subdirectory to place all of these files into. I usually choose DECW_DEF, and since my root directory name is CAMERON, first create the new directory with the following commands (you substitute the name of your root directory where I use CAMERON) :

$SET DEFAULT SYS$LOGIN
$
CREATE/DIRECTORY [CAMERON.DECW_DEF]

I then purge and rename all of the target files into their new directory :

$PURGE DECW$*.DAT
$
RENAME DECW$*.DAT [CAMERON.DECW_DEF]

Now it's time to edit my personal LOGIN.COM file. Once editing the file, I place the following lines in a section of my LOGIN.COM file that is executed by all MODES (for tips on how to optimize your LOGIN.COM file, see the page "Speeding up your LOGIN.COM") :

$LOGIN_DISK = F$TRNLNM ("SYS$DISK")
$
DEFINE/NOLOG MY$DISK 'LOGIN_DISK'
$
DEFINE/NOLOG DECW$USER_DEFAULTS MY$DISK:[CAMERON.DECW_DEF]

Now exit the editor, and completely log out of your session on your workstation. The next time you log in all of your windows defaults will be read in from the files in your new sub directory.


Assigning a new location for the TPU editor Journal files :

By default, the TPU editor creates a TPU journal file for every file you edit, in your login root directory. This file is used to recover any editing work you may have done should the system crash, or some other catastrophic event occurs. Typically the journal file(s) are deleted upon exiting the editor. Where these files are created is based on the definition of two logical names.

If the logical name TPU$JOURNAL is defined, the journal files go to the directory that the logical defines. If TPU$JOURNAL is not defined, the files are created where the logical name SYS$SCRATCH is defined. (See the next section on scratch directories).

So by defining the logical name TPU$JOURNAL in your LOGIN.COM file to point to another directory or sub directory, you can have all the journal files created in other than your login root directory. Here is an example of the logical name definition you might use in your LOGIN.COM file.

$DEFINE/NOLOG TPU$JOURNAL MY$DISK:[CAMERON.TPU_FILES]

Just make sure the directory exists before you make the definition and activate the editor.


Assigning a new scratch directory :

The VMS Operating system has a logical name it defines in each JOB's logical name table called SYS$SCRATCH which is typically defined to a user's login root directory. Many programs and utilities use this logical name to determine where to create temporary scratch files. Naturally, if any of these programs or utilities terminates abnormally, you may be faced with unwanted files in your root directory.

Well, you can change this very easily by yet another logical name definition in your LOGIN.COM file. As before, make sure that the target directory exists prior to making the definition.

Below is an example definition (please note that this definition includes the /JOB qualifier which puts the definition in the JOB's logical name table instead of the process logical name table) :

$DEFINE/NOLOG/JOB SYS$SCRATCH MY$DISK:[CAMERON.SCRATCH]

Another thing to consider when using the logical name SYS$SCRATCH. In an Open VMS Cluster, IO operations to a local disk are always faster than IO operations to a served disk over the network, so if you can assign SYS$SCRATCH to a directory on a local disk, many editing and other application activities can be speeded up.


 

If you have any questions or problems with the above procedure, please feel free to eMail me with the specifics of your problem or question.


My Home Page | VMS Home

DCL | Utilities | Management | Tips

FORTRAN | Pascal

eMail Questions

Quiz?