# File operations

### Appends all text to file <a href="#appends-all-text-to-file" id="appends-all-text-to-file"></a>

Appends all provided text to a file. If the file does not exist, it is created.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter      | Description                                                                                                  |
| -------------- | ------------------------------------------------------------------------------------------------------------ |
| Path           | Path to file to append text to.                                                                              |
| Text to append | Text.                                                                                                        |
| Code page      | Specifies which code page to write the text in. Default 65001 (UTF-8 with BOM). Use 0 for UTF-8 without BOM. |

#### Output <a href="#output" id="output"></a>

No output.

#### Since <a href="#since" id="since"></a>

6.0

### Appends all lines to file <a href="#appends-all-lines-to-file" id="appends-all-lines-to-file"></a>

Appends all provided lines to a file. If the file does not exist, it is created.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter | Description                                                                                                   |
| --------- | ------------------------------------------------------------------------------------------------------------- |
| Path      | Path to file to append lines to.                                                                              |
| Lines     | Lines to append.                                                                                              |
| Code page | Specifies which code page to write the lines in. Default 65001 (UTF-8 with BOM). Use 0 for UTF-8 without BOM. |

#### Output <a href="#output" id="output"></a>

No output.

#### Since <a href="#since" id="since"></a>

6.0

### Check if file exists <a href="#check-if-file-exists" id="check-if-file-exists"></a>

Determains whether file at specified path exists.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter | Description                                                             |
| --------- | ----------------------------------------------------------------------- |
| Path      | The path to the file to check. Path can be UNC path or local file path. |

#### Output <a href="#output" id="output"></a>

Simple value, 'True' if file exists. 'False' otherwise.

#### Since <a href="#since" id="since"></a>

6.0

### Copy file <a href="#copy-file" id="copy-file"></a>

Copies a file to a new location.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter                            | Description                                                                                                                                |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Source                               | The file to move. Path can be UNC path or local file path.                                                                                 |
| Destination                          | The location of the file. Path can be UNC path or local file path.                                                                         |
| Overwrite if destination file exists | If set to True and destination file already exists, it is overwritten. If set to false and file already exists, no copy operation is done. |

#### Output <a href="#output" id="output"></a>

Simple value, 'True' if file was successfully copied. 'False' otherwise.

#### Since <a href="#since" id="since"></a>

6.0

### Delete file <a href="#delete-file" id="delete-file"></a>

Deletes file at provided path.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter | Description                 |
| --------- | --------------------------- |
| Path      | The path to file to delete. |

#### Output <a href="#output" id="output"></a>

Simple value, 'True' if file was successfully deleted. 'False' otherwise.

#### Since <a href="#since" id="since"></a>

6.0

### Get files modification times <a href="#get-files-modification-times" id="get-files-modification-times"></a>

Gets a record containing files modification times.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter | Description                                |
| --------- | ------------------------------------------ |
| Path      | The path to get modification times from.   |
| As UTC    | True to get the modification times in UTC. |

#### Output <a href="#output" id="output"></a>

Record with members 'CreationTime', 'LastWriteTime' and 'LastAccessTime'

#### Since <a href="#since" id="since"></a>

6.0

### Move file <a href="#move-file" id="move-file"></a>

Moves a file to a new location.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter                               | Description                                                                                                                                |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Source                                  | The file to move. Path can be UNC path or local file path.                                                                                 |
| Destination                             | The location of the file. Path can be UNC path or local file path.                                                                         |
| Overwrite destination file if it exists | If set to True and destination file already exists, it is overwritten. If set to false and file already exists, no move operation is done. |

#### Output <a href="#output" id="output"></a>

Simple value, 'True' if file was successfully moved. 'False' otherwise.

#### Since <a href="#since" id="since"></a>

6.0

### Read all bytes from file <a href="#read-all-bytes-from-file" id="read-all-bytes-from-file"></a>

Reads all bytes from a file and puts it a Table variable. Reading too large files can cause performance issues.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter | Description                             |
| --------- | --------------------------------------- |
| Path      | Path to source file to read lines from. |

#### Output <a href="#output" id="output"></a>

Table with column 'value' where each row is one byte from source file.

#### Since <a href="#since" id="since"></a>

6.0

### Read all lines from file <a href="#read-all-lines-from-file" id="read-all-lines-from-file"></a>

Reads all lines from a file and puts it a Table variable. Reading too large files can cause performance issues.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter | Description                                                                                                 |
| --------- | ----------------------------------------------------------------------------------------------------------- |
| Path      | Path to source file to read lines from.                                                                     |
| Code page | Specifies which code page to read the file in. Default 65001 (UTF-8 with BOM). Use 0 for UTF-8 without BOM. |

#### Output <a href="#output" id="output"></a>

Table with column 'value' where each row is one line in source file.

#### Since <a href="#since" id="since"></a>

6.0

### Read all text from file <a href="#read-all-text-from-file" id="read-all-text-from-file"></a>

Reads all text from a file and puts it a simple value variable. Reading too large files can cause performance issues.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter | Description                                                                                                 |
| --------- | ----------------------------------------------------------------------------------------------------------- |
| Path      | Path to source file to read text from.                                                                      |
| Code page | Specifies which code page to read the file in. Default 65001 (UTF-8 with BOM). Use 0 for UTF-8 without BOM. |

#### Output <a href="#output" id="output"></a>

Simple value variable (string), with all content of file in it.

#### Since <a href="#since" id="since"></a>

6.0

### Write all bytes to file <a href="#write-all-bytes-to-file" id="write-all-bytes-to-file"></a>

Writes all provided bytes to a file. If the file already exist, it is overwritten.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter | Description                                                              |
| --------- | ------------------------------------------------------------------------ |
| Path      | Path to file to append text to.                                          |
| Bytes     | A Table containing one column, value, with numeric values (byte, 0-255). |

#### Output <a href="#output" id="output"></a>

No output.

#### Since <a href="#since" id="since"></a>

6.0

### Write all lines to file <a href="#write-all-lines-to-file" id="write-all-lines-to-file"></a>

Writes all provided lines to a file. If the file already exist, it is overwritten..

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter | Description                                                                                                   |
| --------- | ------------------------------------------------------------------------------------------------------------- |
| Path      | Path to file to write lines to.                                                                               |
| Lines     | Lines to write.                                                                                               |
| Code page | Specifies which code page to write the lines in. Default 65001 (UTF-8 with BOM). Use 0 for UTF-8 without BOM. |

#### Output <a href="#output" id="output"></a>

No output.

#### Since <a href="#since" id="since"></a>

6.0

### Write all text to file <a href="#write-all-text-to-file" id="write-all-text-to-file"></a>

Writes all provided text to a file. If the file already exist, it is overwritten.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter     | Description                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------------ |
| Path          | Path to file to write text to.                                                                               |
| Text to write | Text.                                                                                                        |
| Code page     | Specifies which code page to write the text in. Default 65001 (UTF-8 with BOM). Use 0 for UTF-8 without BOM. |

#### Output <a href="#output" id="output"></a>

No output.

#### Since <a href="#since" id="since"></a>

6.1.6

### Write stream to file <a href="#write-stream-to-file" id="write-stream-to-file"></a>

Writes the content of a Flow variable that contains a binary stream to a file. This can for instance be used to write data from a camera input to the file system.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter     | Description                               |
| ------------- | ----------------------------------------- |
| Path          | Path to file to write stream to.          |
| Source stream | Stream to write. Must be a Flow variable. |

#### Output <a href="#output" id="output"></a>

No output.

#### Since <a href="#since" id="since"></a>

6.2
