Capy-Bearer Documentation

file_exists

host call

Capy

function file_exists(path : string) bool

Description

file_exists tests for a regular file. It returns false for a directory. Use file_stat to inspect another path type.

Parameters

path : path to test

Return Values

true when a regular file exists. Otherwise, it returns false.

Example

Capy

file_put_contents("/tmp/doc-exists.txt", "x")
print(file_exists("/tmp/doc-exists.txt"), "\n")