file_exists()

file_exists()#

The file_exists() function checks if a given file exists within a specified directory and is a regular file.

Prototype

BOOL file_exists(
    const char *directory,
    const char *filename
);

Parameters

Key

Type

Description

directory

const char *

The path to the directory where the file is expected to be located.

filename

const char *

The name of the file to check for existence.


Return Value

Returns TRUE if the file exists and is a regular file, otherwise returns FALSE.

Notes

This function constructs the full file path by combining directory and filename, then checks if the file exists and is a regular file using is_regular_file().

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples