The FolderEnum object is returned from the FSUtil.ReadDir method. It lets you enumerate (optionally, recursively) the contents of a folder.
| Property Name | Return Type | Description |
|---|---|---|
attrexclude |
string |
Sets an attribute filter to filter the enumeration. Only items without the specified attributes will be returned. |
attrinclude |
string |
Sets an attribute filter to filter the enumeration. Only items with attributes matching those specified will be returned. For example, folderEnum.attrinclude="hs"; would only return items with both the hidden+system attributes set. |
complete |
bool |
True if the enumeration is complete, otherwise False. |
error |
int |
If an error occurs this will return the error code. It will return 0 on success. |
wildcard |
string |
Set a wildcard pattern to filter the enumeration (prefix with "regex:" for regular expression). For example, folderEnum.wildcard="a*"; would only return filenames beginning with 'a'. |
| Method Name | Arguments | Return Type | Description |
|---|---|---|---|
Close |
none |
none |
Closes the underlying file system handle used to perform the enumeration. You might call this method if you want to delete the folder you just enumerated. After this method is called the complete property will return True. |
Next |
<int:count> |
object:Item or object:Vector |
Returns the next item in the enumeration. By default (with no arguments provided) a single Item object is returned. For higher performance, you can specify a number as the first argument to return more than one item at once - in this case, a Vector of Item objects is returned instead. Specify -1 to return all items in the folder in one call. You can also create your own Vector and pass it as the second argument to stop Opus creating a new Vector each time. |