Sets directory attributes (extended).
DirAttrSetEx (dir-list, attributes, mode)
(s) dir-list a tab or vertical bar delimited list of one or more sub-directory names.
(i) attributes new attribute settings for the directories.
(i) mode specifies the method by which "attributes" are applied to the specified directory(s), and can be one of the following: 0 "attributes" replaces the existing file attributes
1 "attributes" are added to the existing file attributes
-1 "attributes" are removed from the existing file attributes
(i) @TRUE on success, or @FALSE if unable to change the attributes on any of the specified directory(s).
Note: DirAttrSetEx does not accept wildcards.
Value |
Name |
Meaning |
1 |
READONLY |
The file or directory is read-only. Applications can read the file but cannot write to it or delete it. In the case of a directory, applications cannot delete it. |
2 |
HIDDEN |
The file or directory is hidden. It is not included in an ordinary directory listing. |
4 |
SYSTEM |
The file or directory is part of, or is used exclusively by, the operating system. |
16* |
DIRECTORY |
Identifies a directory. |
32 |
ARCHIVE |
The file or directory is an archive file or directory. Applications use this attribute to mark files for backup or removal. |
128 |
NORMAL |
The file or directory has no other attributes set. This attribute is valid only if used alone. |
256 |
TEMPORARY |
The file is being used for temporary storage. File systems avoid writing data back to mass storage if sufficient cache memory is available, because often the application deletes the temporary file shortly after the handle is closed. In that case, the system can entirely avoid writing the data. Otherwise, the data will be written after the handle is closed. |
512* |
SPARSE_FILE |
The file is a sparse file. |
1024* |
REPARSE_POINT |
The file or directory has an associated reparse point. |
2048* |
COMPRESSED |
The file or directory is compressed. For a file, this means that all of the data in the file is compressed. For a directory, this means that compression is the default for newly created files and subdirectories. |
4096 |
OFFLINE |
The data of the file is not immediately available. This attribute indicates that the file data has been physically moved to offline storage. This attribute is used by Remote Storage, the hierarchical storage management software. Applications should not arbitrarily change this attribute. |
8192 |
NOT_CONTENT_INDEXED |
The file will not be indexed by the content indexing service. |
16384* |
ENCRYPTED |
The file or directory is encrypted. For a file, this means that all data streams in the file are encrypted. For a directory, this means that encryption is the default for newly created files and subdirectories. |
* The values with an asterisk next to them cannot be set using DirAttrSetEx.
This function supports extended-length path names.
READONLY = 1 HIDDEN = 2 SYSTEM = 4 DIRECTORY = 16 ARCHIVE = 32 NORMAL = 128 TEMPORARY = 256 COMPRESSED = 2048 OFFLINE = 4096 NOT_CONTENT_INDEXED = 8192 ENCRYPTED = 16384 tmpdir = "c:\Temp\DirAttrSetEx" ; Create a HIDDEN directory DirAttrSetEx(tmpdir, HIDDEN, 1) attr = DirAttrGetEx(tmpdir) If attr & READONLY Message(tmpdir, "READONLY") EndIf If attr & HIDDEN Message(tmpdir, "HIDDEN") EndIf If attr & SYSTEM Message(tmpdir, "SYSTEM") EndIf If attr & DIRECTORY Message(tmpdir, "DIRECTORY") EndIf If attr & ARCHIVE Message(tmpdir, "ARCHIVE") EndIf If attr & NORMAL Message(tmpdir, "NORMAL") EndIf If attr & TEMPORARY Message(tmpdir, "TEMPORARY") EndIf If attr & COMPRESSED Message(tmpdir, "COMPRESSED") EndIf If attr & OFFLINE Message(tmpdir, "OFFLINE") EndIf If attr & NOT_CONTENT_INDEXED Message(tmpdir, "NOT_CONTENT_INDEXED") EndIf If attr & ENCRYPTED Message(tmpdir, "ENCRYPTED") EndIf Exit
DirAttrGet, DirAttrGetEx, FileAttrGetEx, FileAttrSetEx , FileTimeGet, FileTimeTouch