VMS Help DELETE, file *Conan The Librarian (sorry for the slow response - running on an old VAX) |
Deletes one or more files from a mass storage disk volume. Requires delete (D) access to the file and write (W) access to the parent directory. If the target file is itself a directory, the directory must be empty. Format DELETE filespec[,...]
1 - Parameter |
filespec[,...] Specifies the names of one or more files to be deleted from a mass storage disk volume. The first file specification must contain an explicit or default directory specification plus an explicit file name, file type, and version number. Subsequent file specifications need contain only a version number; the defaults will come from the preceding specification. The asterisk (*) and the percent sign (%) wildcard characters can be used in any of the file specification fields. If you omit the directory specification or device name, the current default device and directory are assumed. If the file specification contains a null version number (a semicolon (;) followed by no file version number), a version number of 0, or one or more spaces in the version number, the latest version of the file is deleted. To delete more than one file, separate the file specifications with either commas (,) or plus signs (+).
2 - Qualifiers |
2.1 - /BACKUP
Modifies the time value specified with the /BEFORE or the /SINCE qualifier. The /BACKUP qualifier selects files according to the dates of their most recent backups. This qualifier is incompatible with the /CREATED, /EXPIRED, and /MODIFIED qualifiers, which also allow you to select files according to time attributes. If you specify none of these four time qualifiers, the default is the /CREATED qualifier.
2.2 - /BEFORE
/BEFORE[=time] Selects only those files dated prior to the specified time. You can specify time as absolute time, as a combination of absolute and delta times, or as one of the following keywords: BOOT, LOGIN, TODAY (default), TOMORROW, or YESTERDAY. Specify one of the following qualifiers with the /BEFORE qualifier to indicate the time attribute to be used as the basis for selection: /BACKUP, /CREATED (default), /EXPIRED, or /MODIFIED. For complete information on specifying time values, refer to the OpenVMS User's Manual or the online help topic DCL_Tips (subtopic Date_Time).
2.3 - /BITMAP
/BITMAP=n,x Enables the system manager to delete one or more active bitmaps to make memory resources available. If a bitmap is deleted, then former virtual unit members can only be added with a full copy. Requires ownership of the device or VOLPRO protection. For additional information on bitmaps, refer to Volume Shadowing for OpenVMS.
2.4 - /BY_OWNER
/BY_OWNER[=uic] Selects only those files whose owner user identification code (UIC) matches the specified owner UIC. The default UIC is that of the current process. Specify the UIC by using standard UIC format as described in the OpenVMS Guide to System Security.
2.5 - /CONFIRM
/CONFIRM /NOCONFIRM (default) Controls whether a request is issued before each delete operation to confirm that the operation should be performed on that file. The following responses are valid: YES NO QUIT TRUE FALSE Ctrl/Z 1 0 ALL <Return> You can use any combination of uppercase and lowercase letters for word responses. Word responses can be abbreviated to one or more letters (for example, T, TR, or TRU for TRUE), but these abbreviations must be unique. Affirmative answers are YES, TRUE, and 1. Negative answers include: NO, FALSE, 0, and pressing Return. Entering QUIT or pressing Ctrl/Z indicates that you want to stop processing the command at that point. When you respond by entering ALL, the command continues to process, but no further prompts are given. If you type a response other than one of those in the list, DCL issues an error message and redisplays the prompt.
2.6 - /CREATED
/CREATED (default) Modifies the time value specified with the /BEFORE or the /SINCE qualifier. The /CREATED qualifier selects files based on their dates of creation. This qualifier is incompatible with the /BACKUP, /EXPIRED, and /MODIFIED qualifiers, which also allow you to select files according to time attributes. If you specify none of these four time qualifiers, the default is the /CREATED qualifier.
2.7 - /ERASE
/ERASE /NOERASE (default) When you delete a file, the area in which the file was stored is returned to the system for future use. The data that was stored in that location still exists in the system until new data is written over it. When you specify the /ERASE qualifier, the storage location is overwritten with a system specified pattern so that the data no longer exists.
2.8 - /EXCLUDE
/EXCLUDE=(filespec[,...]) Excludes the specified files from the delete operation. You can include a directory but not a device in the file specification. The asterisk (*) and the percent sign (%) wildcard characters are allowed in the file specification. However, you cannot use relative version numbers to exclude a specific version. If you specify only one file, you can omit the parentheses.
2.9 - /EXPIRED
Modifies the time value specified with the /BEFORE or the /SINCE qualifier. The /EXPIRED qualifier selects files according to their expiration dates. (The expiration date is set with the SET FILE/EXPIRATION_DATE command.) The /EXPIRED qualifier is incompatible with the /BACKUP, /CREATED, and /MODIFIED qualifiers, which also allow you to select files according to time attributes. If you specify none of these four time qualifiers, the default is the /CREATED qualifier.
2.10 - /LOG
/LOG /NOLOG (default) Controls whether the DELETE command displays the file specification of each file after its deletion.
2.11 - /MODIFIED
Modifies the time value specified with the /BEFORE or the /SINCE qualifier. The /MODIFIED qualifier selects files according to the dates on which they were last modified. This qualifier is incompatible with the /BACKUP, /CREATED, and /EXPIRED qualifiers, which also allow you to select files according to time attributes. If you specify none of these four time modifiers, the default is the /CREATED qualifier.
2.12 - /SINCE
/SINCE[=time] Selects only those files dated on or after the specified time. You can specify time as absolute time, as a combination of absolute and delta times, or as one of the following keywords: BOOT, LOGIN, TODAY (default), TOMORROW, or YESTERDAY. Specify one of the following qualifiers with the /SINCE qualifier to indicate the time attribute to be used as the basis for selection: /BACKUP, /CREATED (default), /EXPIRED, or /MODIFIED. For complete information about specifying time values, refer to the OpenVMS User's Manual or the online help topic DCL_Tips (subtopic Date_Time).
2.13 - /STYLE
/STYLE=keyword Specifies the file name format for display purposes while deleting files. The valid keywords for this qualifier are CONDENSED and EXPANDED. Descriptions are as follows: Keyword Explanation CONDENSED Displays the file name representation of what is (default) generated to fit into a 255-length character string. This file name may contain a DID or a FID in the file specification. EXPANDED Displays the file name representation of what is stored on disk. This file name does not contain any DID or FID abbreviations. The keywords CONDENSED and EXPANDED are mutually exclusive. This qualifier specifies which file name format is displayed in the output message, along with the confirmation if requested. File errors are displayed with the CONDENSED file specification unless the EXPANDED keyword is specified. Refer to the OpenVMS Guide to Extended File Specifications for more information.
3 - Examples |
1.$ DELETE COMMON.SUM;2 The DELETE command deletes the file COMMON.SUM;2 from the current default disk and directory. 2.$ DELETE *.OLD;* The DELETE command deletes all versions of files with file type .OLD from the default disk directory. 3.$ DELETE ALPHA.TXT;*, BETA;*, GAMMA;* The DELETE command deletes all versions of the files ALPHA.TXT, BETA.TXT, and GAMMA.TXT. The command uses the file type of the first input file as a temporary default. Note, however, that some form of version number (here specified as the asterisk (*) wildcards) must be included in each file specification. 4.$ DELETE /BEFORE=15-APR/LOG *.DAT;* %DELETE-I-FILDEL, DISK2:[MAIN]ASSIGN.DAT;1 deleted (5 block) %DELETE-I-FILDEL, DISK2:[MAIN]BATCHAVE.DAT;3 deleted (4 blocks) %DELETE-I-FILDEL, DISK2:[MAIN]BATCHAVE.DAT;2 deleted (4 blocks) %DELETE-I-FILDEL, DISK2:[MAIN]BATCHAVE.DAT;1 deleted (4 blocks) %DELETE-I-FILDEL, DISK2:[MAIN]CANCEL.DAT;1 deleted (2 blocks) %DELETE-I-FILDEL, DISK2:[MAIN]DEFINE.DAT;1 deleted (3 blocks) %DELETE-I-FILDEL, DISK2:[MAIN]EXIT.DAT;1 deleted (1 block) %DELETE-I-TOTAL, 7 files deleted (23 blocks) The DELETE command deletes all versions of all files with file type .DAT that were either created or updated before April 15 of this year. The /LOG qualifier not only displays the name of each file deleted, but also the total number of files deleted. 5.$ DELETE A.B; The DELETE command deletes the file A.B with the highest version number. 6.$ DELETE/CONFIRM/SINCE=TODAY [MEIER.TESTFILES]*.OBJ;* DISK0:[MEIER.TESTFILES]AVERAG.OBJ;1, delete? [N]:Y DISK0:[MEIER.TESTFILES]SCANLINE.OBJ;4, delete? [N]:N DISK0:[MEIER.TESTFILES]SCANLINE.OBJ;3, delete? [N]:N DISK0:[MEIER.TESTFILES]SCANLINE.OBJ;2, delete? [N]:N DISK0:[MEIER.TESTFILES]WEATHER.OBJ;3, delete? [N]:Y The DELETE command examines all versions of files with file type .OBJ in the subdirectory [MEIER.TESTFILES], and locates those that were created or modified today. Before deleting each file, it requests confirmation that the file should be deleted. The default response-N-is given in brackets. 7.$ DIRECTORY [.SUBTEST] %DIRECT-W-NOFILES, no files found $ SET PROTECTION SUBTEST.DIR/PROTECTION=OWNER:D $ DELETE SUBTEST.DIR;1 Before the directory file SUBTEST.DIR is deleted, the DIRECTORY command is used to verify that there are no files cataloged in the directory. The SET PROTECTION command redefines the protection for the directory file so that it can be deleted; then the DELETE command deletes it. 8.$ DELETE DALLAS"THOMAS SECRET"::DISK0:[000,000]DECODE.LIS;1 This DELETE command deletes the file DECODE.LIS;1 from the directory [000,000] on device DISK0 at remote node DALLAS. The user name and password follow the remote node name. 9.$ DELETE NODE12::"DISK1:DEAL.BIG" $ DELETE NODE12::DISK1:DEAL.BIG; Either of these DELETE commands can be used to delete the file DEAL.BIG on device ZZZ1 at remote node NODE12. Note that the DELETE command requires an explicit version number in a file specification, but the file to be deleted is on a remote node whose file syntax does not recognize version numbers. (NODE12 is an RT-11 node.) Therefore, the file specification must either be enclosed in quotation marks (" ") or entered with a null version number (that is, a trailing semicolon [;]).
|