# ListFiles

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Unknown

Source code: <https://github.com/FrendsPlatform/Frends.Smb/tree/main/Frends.Smb.ListFiles>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                     | Description                                                                                                                                                                     |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Directory : `PathString` | <p>Directory from which we want to list files. If you want to list files from the root share, use "/"</p><p><br>Default: <code>-</code><br>Example: <code>files/temp</code></p> |
| {% endtab %}             |                                                                                                                                                                                 |

{% tab title="Parameter: Connection" %}

| Name                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Server : `String`      | <p>SMB server address or hostname.</p><p><br>Default: <code>-</code><br>Example: <code>127.0.0.1</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Share : `String`       | <p>SMB share name to connect to.</p><p><br>Default: <code>-</code><br>Example: <code>testShare</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Username : `String`    | <p>Username for SMB authentication.</p><p>This needs to be of format domain\username</p><p><br>Default: <code>-</code><br>Example: <code>WORKGROUP\Administrator</code></p>                                                                                                                                                                                                                                                                                                                                                         |
| 🗝Password : `String`  | <p>Password for the SMB credentials.</p><p><br>Default: <code>-</code><br>Example: <code>Password123</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                     |
| OperatingSystem : `Os` | <p>Defines the operating system of the SMB server.</p><p>Options used to determine correct path separator to use.</p><p>Possible values:</p><ul><li><code>Windows</code>:</li></ul><p>Defines the operating system of the SMB server.</p><p>Options used to determine correct path separator to use.</p><ul><li><code>Linux</code>:</li></ul><p>Defines the operating system of the SMB server.</p><p>Options used to determine correct path separator to use.</p><p><br>Default: <code>2</code><br>Example: <code>Linux</code></p> |
| {% endtab %}           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

{% tab title="Parameter: Options" %}

| Name                                        | Description                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SearchRecursively : `Boolean`               | <p>Whether to list files recursively or not.</p><p><br>Default: <code>False</code><br>Example: <code>false</code></p>                                                                                                                                                                                         |
| PatternMatchingMode : `PatternMatchingMode` | <p>Define how pattern matching will work.</p><p>Possible values:</p><ul><li><code>Wildcards</code>:</li></ul><p>Define how pattern matching will work.</p><ul><li><code>Regex</code>:</li></ul><p>Define how pattern matching will work.</p><p><br>Default: <code>2</code><br>Example: <code>Regex</code></p> |
| Pattern : `String`                          | <p>Define how pattern matching will work.</p><p><br>Default: <code>-</code><br>Example: <code>Regex</code></p>                                                                                                                                                                                                |
| ThrowErrorOnFailure : `Boolean`             | <p>Whether to throw an error on failure.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                               |
| ErrorMessageOnFailure : `String`            | <p>Overrides the error message on failure.</p><p><br>Default: <code>-</code><br>Example: <code>Custom error message</code></p>                                                                                                                                                                                |
| {% endtab %}                                |                                                                                                                                                                                                                                                                                                               |

{% tab title="Result: Result" %}

| Name                 | Description                                                                                                                                                                                                    |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success : `Boolean`  | <p>Indicates if the task completed successfully.<br>Example: <code>true</code></p>                                                                                                                             |
| Files : `FileItem[]` | <p>List of files in a share<br>Example: <code>\[{ Name: "foo.txt", Path: "files/temp/foo.txt", SizeInMegabytes: 1, ... }, { Name: "bar.txt", Path: "files/temp/bar.txt", SizeInMegabytes: 2, ... }]</code></p> |
| Error : `Error`      | <p>Error that occurred during task execution.<br>Example: <code>object { string Message, Exception AdditionalInfo }</code></p>                                                                                 |
| {% endtab %}         |                                                                                                                                                                                                                |

{% tab title="Changelog" %}

## Changelog

### \[2.0.0] - 2026-04-08

#### Added

* New connection parameters that defined what servers Operating System.
* \[Breaking Change] Introduce PathString type that will represent paths with OS specific separators.

### \[1.0.0] - 2025-11-07

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
