# FolderEnum

The **FolderEnum** object is returned from the [**FSUtil**](fsutil)**.ReadDir** method. It lets you enumerate (optionally, recursively) the contents of a folder.

| Property Name | Return Type | Description                                                                      |
| ------------- | ----------- | -------------------------------------------------------------------------------- |
| 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. |

| 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        | <p>&#x3C;int:count><br>&#x3C;<a href="vector"><strong>Vector</strong></a>:vector></p> | <p><em>object:</em><a href="item"><strong>Item</strong></a> </p><p>or</p><p><em>object:</em><a href="vector"><strong>Vector</strong></a></p> | <p>Returns the next item in the enumeration.</p><p>By default (with no arguments provided) a single <a href="item"><strong>Item</strong></a> 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 <a href="vector"><strong>Vector</strong></a> of <a href="item"><strong>Item</strong></a> objects is returned instead. Specify <strong>-1</strong> to return all items in the folder in one call.</p><p>You can also create your own <a href="vector"><strong>Vector</strong></a> and pass it as the second argument to stop Opus creating a new <a href="vector"><strong>Vector</strong></a> each time.</p> |
