rmrcontentdir()

rmrcontentdir()#

The function rmrcontentdir recursively removes the contents of a directory without deleting the directory itself.

Prototype

int rmrcontentdir(const char *root_dir);

Parameters

Key

Type

Description

root_dir

const char *

Path to the directory whose contents should be removed.


Return Value

Returns 0 on success, or -1 if an error occurs.

Notes

This function does not remove the root directory itself, only its contents. It skips special entries like . and .. and handles both files and subdirectories recursively.

Prototype

// Not applicable in JS

Prototype

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