commands/PROTECT commands/PROTECT
NAME
PROTECT - Change the protection bits of a file.
FORMAT
PROTECT [FILE] <file|pattern> [FLAGS] [+|-] [<flags>]
[ADD|SUB] [ALL] [QUIET] [GROUP] [OTHER] [CLONE]
[CLEAR] [FILES] [DIRS]
TEMPLATE
FILE/A,FLAGS,ADD/S,SUB/S,ALL/S,QUIET/S,USER/S,GROUP/S,
OTHER/S,CLONE/S,CLEAR/S,FILES/S,DIRS/S
PATH
C:PROTECT
FUNCTION
All files have a series of protection bits stored with them which control their attributes. These bits can be altered to indicate the type of file and the file operations permitted. PROTECT is used to set or clear the protection bits of a file.
The protection bits are represented by letters:
r The file can be read.
w The file can be written to (altered).
e The file is executable (a program).
d The file can be deleted.
s The file is a script.
p The file is a pure command and can be made resident.
a The file has been archived.
h The command file should be held resident in memory after it has
been used (requires that the 'p' bit is set, too)
To see the protection bits associated with a file, use the LIST command. The protection field is displayed with set (on) bits shown by their letters and clear (off) bits shown by hyphens. For instance, a file that is readable, writable and deletable, will have ----rw-d in the protection field.
To specify the entire protection field at once, simply give the letters of the bits you want set as the FLAGS argument, without any other keywords. The named bits will be set, and all the others will be cleared.