Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.stsci.edu/ftp/documents/system-docs/vms-guide/html/VUG_23.html
Дата изменения: Wed Nov 1 17:38:23 1995 Дата индексирования: Sun Dec 23 18:30:05 2007 Кодировка: Поисковые слова: п п п п п п п п п п п п п п п п п п п п п п п р п р п р п р п р п |
Listing Directory Contents: DIRECTORY
Directories are most valuable simply to keep track of existing files. During a single terminal session you may create or change many files. Typing DIR
at the system prompt will list all the files in the current directory. If there are no files in the current directory, the system will respond with the following message:
DIRECT-W-NOFILES, no files found
Many qualifiers are available for the DIRECTORY
command. Table 3.2 lists some of the more useful qualifiers ; for information about other options, see the online help.
Create a directory using the
There are two special cases in navigating directories: you can always move to your root directory by typing
Generated with CERN WebMaker
Table 3.2: DIRECTORY Qualifiers
Creating and Navigating Subdirectories
Directories imply a hierarchical structure with a common directory called the home or root directory and several layers of user-defined subdirectories. You can create directories for any type of data. For example, you may wish to have separate directories for your text documents, FORTRAN programs, and personal utilities.CREATE/DIR
command. For example, to create a subdirectory in the current directory called FOR
, you would type the following command:
$ CREATE/DIR [.FOR]
The directory will have the filename FOR.DIR
. If you type DIR
to see the contents of the directory, you should see the directory file. You can then move into that directory (i.e., make it your default) by typing:
$ SET DEFAULT [.FOR]
Note the syntax used in these commands. When creating a directory, you must enclose its name in brackets, and whenever you specify a subdirectory name you must precede its name with a period. SET
DEF
SYS$LOGIN
, and you can move up one directory level by typing SET
DEFAULT
[-]
.
Do not edit or rename files that are directories (*
.DIR
). Doing so can orphan, or cause the file system to lose, files in that directory.
Deleting a Directory
A directory can be deleted using the DELETE
command, just like you would delete a file, except that the directory must be empty (no files in it) and the protection on the .DIR
file must be changed to allow deletion. The following steps will delete a directory:
SET
DEFAULT
command, for example:
$ SET DEF [.OLDFILES]
DIRECTORY
command.If the directory is empty, you will get the following message:
% DIRECT-W-NOFILES, no files found
$ DEL *.*;*
Before removing all files in a directory, check to make sure that you're in the correct directory, otherwise you could inadvertently delete the wrong files. Check the current directory by typing:
$ SHOW DEF
$ SET DEF [-]
$ SET PROT=(O:D) OLDFILES.DIR;1
$ DELETE OLDFILES.DIR;1