SetFileAttributes()
Summary
Changes the attributes of a file or a directory.
Changes
Added to Version 5.0.
Syntax
SetFileAttributes(string path, array options)
| Argument | Contents |
|---|---|
| path | The full or partial path of the file or directory |
| Option | Type | Contents |
|---|---|---|
| Read Only | Boolean | Whether to mark the file as read only ("True") or writeable ("False") |
| Hidden | Boolean | Whether to mark the file as hidden ("True") or not ("False") |
| System | Boolean | Whether to mark the file as a system file ("True") or not ("False") |
Notes
-
The options not provided are not modified.
-
For more information on full and partial paths, see Identifying Files and Folders.
Example
SetFileAttributes("c:\\temp\\myfile.txt", {{"Read Only", "True"}})
Error Codes
| Error Type | Meaning |
|---|---|
| NotFound | The file was not found |
See Also
| Function | Summary |
|---|---|
| GetDirectoryInfo() | Gets a listing of the contents of a directory |
| GetFileInfo() | Gets information about a file |
| SearchFilePath() | Searches for the path for a filename |