SpartaDOS X Reference Manual

The Command Processor — Commands




ATR (Attributes) Command

Index


Purpose Sets/clears file attributes in the directory. Replaces the Protect and Unprotect functions from older SpartaDOS versions.
 
Syntax ATR [+A|H|P] [-A|H|P] [d:][path]fname[.ext]
 
Alias ATTRIB
 
Type Internal
 
Related DIR
 
Remarks   SpartaDOS X adds two new attributes to the standard SpartaDOS directory entry — these are the hidden and archived bits. The old commands PROTECT and UNPROTECT were used to set or clear the protection bit. With SpartaDOS X, the ATR command replaces the old commands and works with the new attributes.

Although many other commands allow the usage of the "S" (subdirectory) attribute, it is illegal to attempt to change this status bit as it would corrupt the subdirectory integrity. Therefore, ATR does not affect this.

Note that although the syntax of the ATR command looks similar to that of the DIRectory or TYPE commands, the attributes here are not the scan mode, but describe the set(+)/clear(-) attributes operation to be performed on the directory entry that matches the given filespec. This means that the scope of the ATR command is all files matching the filespec (including those files which are hidden).

The directory entry attributes are as follows:

A   Archived file. This attribute is cleared whenever a file is created or updated. The archive bit is set when the file is backed up by a program such as FlashBack!. This attribute is not related to the ARC command.
 
H   Hidden file. You may hide files and/or subdirectories. If a file is hidden, you may load it as a command only — commands such as TYPE and COPY will not see hidden files (unless you specify attributes with those commands). The file is hidden when this bit is set.
 
P   Protected file. You may not ERASE, or update protected files. Use the ATR command to protect or unprotect files. The file is protected when this bit is set.
 
S   Subdirectory. This attribute is unchangeable — thus not legal in the ATR command! This bit is set to indicate a subdirectory. If cleared, it would be seen as a file which could cause significant damage.

For example, to set the archived status and clear the protection bit of all ".COM" files, type the command

    ATR +A -P *.COM

For further information about which status bits in the directory entry are affected by these new attributes, refer to the "Technical Information" chapter.


Previous page

Next page