Files
fn_registry/bash/functions/shell/assert_file_exists.md
T
egutierrez 3043518fec docs: CLAUDE.md actualizado con fn run, tipos Go en functions/, bash functions
Documentación de fn run para todos los lenguajes, nueva ubicación de tipos Go,
sección de uso por agentes. Añadidas funciones Bash del registry (shell, infra,
core, pipelines).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:23:30 +01:00

1.0 KiB

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, 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 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
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.