Write File
Write File
Section titled “Write File”Type: write-file · Package: Filesystem Activities v1.0.0 · Output: string
Writes a text string to a file. If the file does not exist, it creates it; if it exists, it replaces it by default. Use it to generate output files: a log, a text report, a configuration file.
How it works
Section titled “How it works”Write the content to the path file. By default it overwrites the existing file (overwrite = true). If you put overwrite = false and the file already exists, the activity fails instead of replacing it.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
path | expression | Path of the file to write. |
content | expression | The text to write. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
encoding | text | File encoding. By default "utf-8". |
overwrite | boolean | Replace if it already exists. By default true. |
Output
Section titled “Output”Returns the path of the written file, in case you want to capture it into an output variable.
Example
Section titled “Example”Write File path = = "C:/salida/resultado.txt" content = = "Proceso completado: " + now().ToString("yyyy-MM-dd HH:mm")Related activities
Section titled “Related activities”- Append to File — append to the end without replacing.
- Read File — read the file back.
- Create Directory — ensure that the destination folder exists.