Skip to content

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.

Almost all activities receive a route. You can indicate it in two ways:

  • Absolute path: C:\reportes\salida.txt or C:/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().

Be careful with the default values, which are not the same in all activities:

ActivityDefault overwrite
Write Filetrue — replaces existing file
Copy File / Move Filefalse — fails if the destination already exists
ActivityTypeOutputWhat it does
Read Fileread-filestringRead the content of a text file
Write Filewrite-fileWrites text to a file (creates or replaces it)
Append to Fileappend-fileAdd text to the end of a file
ActivityTypeOutputWhat it does
File Existsfile-existsbooleanDoes the file exist?
Copy Filecopy-fileCopy a file to another path
Move Filemove-fileMove or rename a file
Delete Filedelete-fileDelete a file
ActivityTypeOutputWhat it does
Create Directorycreate-directoryCreate a folder (and any missing ones in the path)
List Fileslist-filesstring[]List files/folders in a directory

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))