> For the complete documentation index, see [llms.txt](https://chaoses-ib.gitbook.io/directory-opus/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/fileattr.md).

# FileAttr

The **FileAttr** object is provided to make it easier to deal with file attributes. Rather than dealing with attributes as a string of characters, or a number, it provides properties for each attribute that can be set or queried independently. You can create a new **FileAttr** object using the [**FSUtil**](/directory-opus/manual/reference/scripting_reference/scripting_objects/fsutil.md)**.NewFileAttr** method. **FileAttr** objects are also returned by properties of the [**Format**](/directory-opus/manual/reference/scripting_reference/scripting_objects/format.md) and [**Item**](/directory-opus/manual/reference/scripting_reference/scripting_objects/item.md) objects.

Each attribute is represented by two properties; a single character (e.g. **a**) and its full name (e.g. **archive**). Each property returns **True** if the attribute is set, and **False** if not. For **FileAttr** objects you create yourself, you can also set the value of these properties (and then, for example, apply the attributes to a file using the [**File**](/directory-opus/manual/reference/scripting_reference/scripting_objects/file.md)**.SetAttr** method).

&#x20;

| Property Name          | Return Type | Description                                                                                                                                                                                                                                                                                      |
| ---------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| *\<default value>*     | *string*    | Returns a string representing the attributes that are set (similar to the format displayed in the *Attr* column in the file display).                                                                                                                                                            |
| <p>a<br>archive</p>    | *bool*      | A file or directory that has changes which need archiving. The A bit is usually set on new or modifies files, and may then be cleared by backup software after it has added the changes to a backup.                                                                                             |
| <p>c<br>compressed</p> | *bool*      | A file or directory that is compressed. For a file, all of the data in the file is compressed. For a directory, compression is the default for newly created files and subdirectories.                                                                                                           |
| <p>e<br>encrypted</p>  | *bool*      | A file or directory that is encrypted. For a file, all data streams in the file are encrypted. For a directory, encryption is the default for newly created files and subdirectories.                                                                                                            |
| <p>h<br>hidden</p>     | *bool*      | The file or directory is hidden. It is not included in an ordinary directory listing.                                                                                                                                                                                                            |
| <p>i<br>nonindexed</p> | *bool*      | The file or directory is not to be indexed by the content indexing service.                                                                                                                                                                                                                      |
| <p>o<br>offline</p>    | *bool*      | The data of a file is not available immediately. This attribute indicates that the file data is physically moved to offline storage. This attribute is used by Remote Storage, which is the hierarchical storage management software. Applications should not arbitrarily change this attribute. |
| <p>p<br>pinned</p>     | *bool*      | The data of the file is to be kept available at all times; it should not be offloaded to offline storage.                                                                                                                                                                                        |
| <p>r<br>readonly</p>   | *bool*      | A file that is read-only. Applications can read the file, but cannot write to it or delete it. This attribute is not honored on directories.                                                                                                                                                     |
| <p>s<br>system</p>     | *bool*      | A file or directory that the operating system uses a part of, or uses exclusively.                                                                                                                                                                                                               |

| Method Name | **Arguments**                         | Return Type | Description                                                                                                                                                      |
| ----------- | ------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Assign      | \*object:\***FileAttr\\** or *string* | none        | Assigns a new set of attributes to this object. You can pass another **FileAttr** object, or a string (e.g. *"hsr"*).                                            |
| AttrName    | *string*                              | *string*    | Given a single character representing an attribute (e.g. *"a"*) this method returns the name of the attribute in the user's current language (e.g. *"Archive"*). |
| Clear       | \*object:\***FileAttr\\** or *string* | none        | Clears (turns off) the specified attributes in this object. You can pass another **FileAttr** object, or a string representing the attributes to turn off.       |
| Set         | \*object:\***FileAttr\\** or *string* | none        | Sets (turns on) the specified attributes in this object. You can pass another **FileAttr** object, or a string representing the attributes to turn on.           |
| ToString    | none                                  | none        | Returns a string representing the attributes that are set (similar to the format displayed in the *Attr* column in the file display).                            |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/fileattr.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
