PURGE Command Accepts Wildcards [ COMMUNICATOR 3000 MPE/iX General Release 5.0 (Core Software Release C.50.00) ] MPE/iX Communicators
COMMUNICATOR 3000 MPE/iX General Release 5.0 (Core Software Release C.50.00)
PURGE Command Accepts Wildcards
by Yuki Umezawa
Software Technology Division
New PURGE Feature
Now available with the MPE/iX release is an enhancement to the PURGE
command that allows multiple files to be deleted by specifying a fileset
with the wild card characters. This capability is already available on
the MPE V operating system. It enables the migration of applications
that use this capability from MPE V systems to MPE/iX systems. It
supports a fileset specified with the standard wild card characters used
by the LISTFILE command; that is, it supports a fileset not only in MPE
syntax but also in HFS syntax.
Several new options were added to the PURGE command to allow flexibility
in handling multiple files. These options are shown in the following new
syntax of the command and are discussed in more detail in the remainder
of this article.
PURGE Syntax
PURGE fileset [;{TEMP}]
[;ONLOCKWORD={SELECT}]
{SKIP }
[;ONERROR= {CONTINUE}]
{QUIT }
[{;NOAUTOLOCKWORD}]
{;AUTOLOCKWORD }
[{;CONFIRM }]
{;NOCONFIRM }
{;CONFIRMALL}
[{;NOSHOW}]
{;SHOW }
[{;NOSHOWERROR}]
{;SHOWERROR }
The first option is the ONLOCKWORD keyword parameter. This parameter
allows you to control whether files with lockwords are deleted or
skipped. This option is available for all the users.
The ONERROR keyword parameter was added to allow you to control whether
the PURGE command should continue upon encountering an error. The
default is to CONTINUE executing the PURGE command upon encountering an
error. The other option is to specify ONERROR=QUIT.
The AUTOLOCKWORD option is now available to SM/AM users to purge files
without having to respond to lockword prompts. With this privileged
option, the system will look up lockwords and automatically resolve
lockword checking. For AM users, AUTOLOCKWORD is effective only for the
files in the user logon account. The default is NOAUTOLOCKWORD.
The next option that was added for flexibility is the CONFIRM, CONFIRMALL
or NOCONFIRM option. With the CONFIRM option you are prompted once to
verify that the fileset specified is correct. If you respond with a yes,
all files that match the fileset specified are deleted. The CONFIRMALL
option requires confirmation on each file before it is deleted. When
NOCONFIRM is specified there is no verification performed. The NOCONFIRM
value is the default if the PURGE command is executed from batch mode.
The CONFIRM value is the default if the PURGE command is executed
interactively.
The SHOW/NOSHOW option allows you to control whether the filenames are
displayed to $STDLIST as they are deleted.
The SHOWERROR/NOSHOWERROR option controls the detail of error messages
that are displayed. NOSHOWERROR displays only a high level message that
indicates which files were not deleted due to an error. SHOWERROR
displays additional, more detailed, error messages indicating why a file
was not deleted. NOSHOWERROR is the default value for this option.
Examples
Delete a set of MPE files:
PURGE FOO@
NOTE Since AUTOLOCKWORD is not specified, the system prompts for
lockwords if it encounters any files with lockwords.
Delete a set of POSIX files with confirmation on individual files:
PURGE ./mydir/foo[0-9];CONFIRMALL
The confirmation dialog for the above command:
4 FILEs matched
./mydir/foo1 ? (NO/YES/QUIT)no
./mydir/foo2 ? (NO/YES/QUIT)yes
./mydir/foo3 ? (NO/YES/QUIT)quit
1 selected. 1 succeeded. 0 failed.
When an error is encountered in deleting a single file, the following
error messages are displayed:
PURGE FOO
EXCLUSIVE VIOLATION: FILE ACCESSED EXCLUSIVELY (FSERR 91)
Unable to purge file "FOO.PUB.SYS". (CIERR 384)
When errors are encountered in deleting a set of files, the following
error messages are displayed:
PURGE FOO@
Unable to purge file "FOO1.PUB.SYS". (CIERR 384)
Unable to purge file "FOO2.PUB.SYS". (CIERR 384)
Display the detailed errors, as they are encountered, on a set of files:
PURGE FOO@;SHOWERROR
EXCLUSIVE VIOLATION: FILE ACCESSED EXCLUSIVELY (FSERR 91)
Unable to purge file "FOO1.PUB.SYS". (CIERR 384)
EXCLUSIVE VIOLATION: FILE ACCESSED EXCLUSIVELY (FSERR 91)
Unable to purge file "FOO2.PUB.SYS". (CIERR 384)
Stop the purge if an error is encountered:
PURGE FOO@;ONERROR=QUIT
Skip files that contain a lockword:
PURGE FOO@;ONLOCKWORD=SKIP
Delete files with a lockword without having to respond to lockword
prompts:
PURGE FOO@;AUTOLOCKWORD
NOTE To specify the AUTOLOCKWORD option, you need to have SM or AM
capability.
MPE/iX Communicators