Files
fn_registry/bash/functions/shell/assert_file_exists.md
T
egutierrez fc4180cbb3 chore: auto-commit (129 archivos)
- .claude/agents/fn-analizador/SKILL.md
- .claude/agents/fn-constructor/SKILL.md
- .claude/agents/fn-executor/SKILL.md
- .claude/agents/fn-mejorador/SKILL.md
- .claude/agents/fn-orquestador/SKILL.md
- .claude/agents/fn-recopilador/SKILL.md
- .claude/commands/app.md
- .claude/commands/compile.md
- .claude/commands/cpp-app.md
- .claude/commands/create_functions.md
- ...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-01 22:23:12 +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/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.