The Item object represents a file or folder displayed in a tab. You can obtain a collection of Item objects from the various methods of the Tab object. A collection of Item objects is also used with the Command object to specify the files or folders a command should operate on. Using the FSUtil.ReadDir method to enumerate the contents of a folder also returns an Item object.
Property Name |
Return Type |
Description |
---|---|---|
<default value> |
string |
Returns the full pathname of the item (i.e. path plus filename). |
access |
date |
Returns the "last accessed" date, in local time. |
access_utc |
date |
Returns the "last accessed" date, in UTC. |
attr |
int |
Returns the item attributes. This value is a series of flags that are
logically OR'd together. The attributes supported by Opus are: |
attr_text |
string |
Returns the item attributes as a string, as displayed in the file display. |
checked |
bool |
Returns True if the item was checked (in checkbox mode), or False otherwise. |
create |
date |
Returns the "creation" date, in local time. |
create_utc |
date |
Returns the "creation" date, in UTC. |
display_name |
string |
Returns the display name of the item. Only a few items have a display name that is different to their actual name - some examples are certain system folders (like C:\Users which might have a translated display name in non-English locales). |
ext |
string |
Returns the filename extension. |
failed |
bool |
Returns True if the item failed when used by a command. This is only meaningful in conjunction with the Command.files collection - once the command has returned, this property will indicate success or failure on a per-file basis. |
got_size |
bool |
Returns True for folder items if their size has been calculated by, for example, the GetSizes command. If False, the size property will be unreliable for folders. |
groups |
Returns a Vector of FiletypeGroup objects representing any and all file type groups that this file is a member of. | |
id |
int |
This is a unique ID for the item; it is used internally by Opus. |
is_dir |
bool |
Returns True if the item represents a folder, and False for a file. |
metadata |
object:Metadata |
Returns a Metadata object that provides access to the item's metadata. |
modify |
date |
Returns the "last modified" date, in local time. |
modify_utc |
date |
Returns the "last modified" date, in UTC. |
name |
string |
Returns the name of the item. |
name_stem |
string |
Returns the filename "stem" of the item. This is the name of the item with the filename extension removed. It will be the same as the name for folders. |
path |
object:Path |
Returns the path of the item's parent folder. This does not include the name of the item itself, which can be obtained via the name property. |
realpath |
object:Path |
Returns the "real" path of the item. For items located in virtual folders like Libraries or Collections, this lets you access the item's underlying path in the real file system. The realpath property includes the full path to the item, including its own name. |
selected |
bool |
Returns True if the item was selected, or False otherwise. |
size |
object:FileSize |
Returns the size of the item as a FileSize object. |
Method Name |
Arguments |
Return Type |
Description |
---|---|---|---|
Open |
<string:path> |
object:File |
Opens this file and returns a File object
that lets you access its contents as binary data. When opening in write mode, you can also specify optional flags that
control how the file is opened: |