Filesystem Activities
Version: 1.0.0 · ID: zoan-packages-fs · Author: Zoan Software
The Files (filesystem) package works with system files and folders: reading and writing text files, copying, moving, deleting, checking if something exists, and listing the contents of a folder. It is a support package present in almost every automation — to organize downloads, generate output files, move processed documents or read configuration data.
File paths
Section titled “File paths”Almost all activities receive a route. You can indicate it in two ways:
- Absolute path:
C:\reportes\salida.txtorC:/reportes/salida.txt. In expressions, remember that the backslash is written literally:= "C:\reportes\" + nombre. See Windows paths. - Project file with
asset(...): For files that travel within your package (templates, example data), use= asset("datos/entrada.txt"). Solve the correct route no matter what machine you run on. See asset().
Sobrescritura (overwrite)
Section titled “Sobrescritura (overwrite)”Be careful with the default values, which are not the same in all activities:
| Activity | Default overwrite |
|---|---|
| Write File | true — replaces existing file |
| Copy File / Move File | false — fails if the destination already exists |
Activities
Section titled “Activities”Read and write text
Section titled “Read and write text”| Activity | Type | Output | What it does |
|---|---|---|---|
| Read File | read-file | string | Read the content of a text file |
| Write File | write-file | — | Writes text to a file (creates or replaces it) |
| Append to File | append-file | — | Add text to the end of a file |
File operations
Section titled “File operations”| Activity | Type | Output | What it does |
|---|---|---|---|
| File Exists | file-exists | boolean | Does the file exist? |
| Copy File | copy-file | — | Copy a file to another path |
| Move File | move-file | — | Move or rename a file |
| Delete File | delete-file | — | Delete a file |
Carpetas
Section titled “Carpetas”| Activity | Type | Output | What it does |
|---|---|---|---|
| Create Directory | create-directory | — | Create a folder (and any missing ones in the path) |
| List Files | list-files | string[] | List files/folders in a directory |
A typical flow
Section titled “A typical flow”Process each downloaded file and archive it:
List Files path = "C:/descargas" pattern = "*.xlsx" → output: archivos
For Each items = = archivos itemVariable = ruta └─ activities: ... procesar el archivo ... Move File source = = ruta destination = = pathJoin("C:/procesados", fileName(ruta))Next steps
Section titled “Next steps”- Read File / Write File — most used.
- List Files — browse through a folder.
- Expressions › Files and paths —
pathJoin,fileName,asset…