Files
fn_registry/bash/functions/shell/assert_file_exists.md
T
egutierrez 988e901066 docs: params/output semántico en 506 funciones para composabilidad
Añade campos params y output al frontmatter YAML de las 506 funciones del registry.
Cada parámetro tiene descripción semántica (qué representa, unidades, rango típico)
y cada función describe qué produce su output. Permite a agentes razonar sobre
cadenas de composición (ej: prices → log_return → sharpe_ratio) sin leer código.
2026-04-05 18:45:16 +02:00

1.1 KiB

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
name kind lang domain version purity signature description tags uses_functions uses_types returns returns_optional error_type imports params output tested tests test_file_path file_path
assert_file_exists function bash shell 1.0.0 impure assert_file_exists(file_path: string) -> string Verifica que un archivo existe en el filesystem. Imprime su tamaño en bytes a stdout. Sale con exit code 1 si el archivo no existe.
assert
file
exists
validation
shell
bash
false error_go_core
name desc
file_path ruta del archivo a verificar
tamaño del archivo en bytes false
bash/functions/shell/assert_file_exists.sh

Ejemplo

source functions/shell/assert_file_exists.sh

size=$(assert_file_exists /home/lucas/fn_registry/registry.db)
echo "Tamaño: $size bytes"

Notas

La función se sourcea, no se ejecuta directamente. Usa stat -c%s para obtener el tamaño en bytes (compatible con GNU coreutils / Linux).

Output limpio: solo el número de bytes a stdout. Los errores van a stderr.

No usa set -e internamente — el caller controla el flujo con el exit code de retorno.