SpartaDOS X Reference Manual

Programming with SpartaDOS X




Set Attributes (ATR)

Index


Purpose To manipulate the protected, hidden, and archived status of files.
 
Syntax

XIO 49, #IOCB,aux1,aux2,"Dd:fname.ext"
 

Remarks

This is used to modify the attributes of a file or files. Wildcards are allowed in fname.ext. Aux1 is used to select which attributes are to be changed and whether they will be set or cleared. Aux2 is used to determine which files are to be affected.

To perform the desired attribute modification, add the following values to aux1, assuming an initial value of zero:

Protect add 1 Unprotect add 16
Hide add 2 Unhide add 32
Set archive add 4 Clear archive add 64

Aux2 is used exactly as with the scan mode of the open statement. It will select the files to be affected by current attribute status. These values should be added to aux2, starting with a base value of 0:

Protected add 1 Unprotected add 16
Hidden add 2 Not hidden add 32
Archived add 4 Not archived add 64
Subdirectory add 8 Not a subdirectory add 128

For example, to hide all of the files on drive #1 with a .BAK extender, use

    XIO 49,#1,2,0,"D1:*.BAK"

To protect and set the archive bit for all of the hidden files on drive #1, use

    XIO 49,#1,1+4,2,"D1:*.*"

and to unhide and unprotect all the hidden files with a *.BAK extender on drive #1, use

    XIO 49,#1,16+32,2,"D1:*.BAK"

The IOCB should be closed for this operation.


Previous page

Next page