#include <removefile.h>

removefile.h

includes: stdint.h
7 functions · 3 typedefs · 3 enums

typedefremovefile_flags_t

Flags
typedef uint32_t removefile_flags_t

enum(anonymous)

underlying type unsigned int
REMOVEFILE_RECURSIVE1If path is a directory, recurse (depth first traversal)
REMOVEFILE_KEEP_PARENT2Remove contents but not directory itself
REMOVEFILE_SECURE_7_PASS47 pass DoD algorithm
REMOVEFILE_SECURE_35_PASS835-pass Gutmann algorithm (overrides REMOVEFILE_SECURE_7_PASS)
REMOVEFILE_SECURE_1_PASS161 pass single overwrite
REMOVEFILE_SECURE_3_PASS323 pass overwrite
REMOVEFILE_SECURE_1_PASS_ZERO64Single-pass overwrite, with 0 instead of random data
REMOVEFILE_CROSS_MOUNT128Cross mountpoints when deleting recursively.
REMOVEFILE_ALLOW_LONG_PATHS256Paths may be longer than PATH_MAX - requires temporarily changing cwd
REMOVEFILE_CLEAR_PURGEABLE512Clear purgeable on any directory encountered before deletion
REMOVEFILE_SYSTEM_DISCARDED1024File Discarded by system
REMOVEFILE_RECURSIVE_SLIM2048Slim implementation of dir removal, which iterates the directory in DFS, to reduce memory consumption.

typedefremovefile_state_t

State object to pass in callback information
typedef struct _removefile_state * removefile_state_t

functionremovefile_state_alloc

removefile_state_t removefile_state_alloc(void)

functionremovefile_state_free

int removefile_state_free(removefile_state_t)

functionremovefile_state_get

int removefile_state_get(removefile_state_t state, uint32_t key, void * dst)

functionremovefile_state_set

int removefile_state_set(removefile_state_t state, uint32_t key, const void* value)
man page · August 4, 2023
removefile_state_set(3) — remove files or directories

enum(anonymous)

underlying type unsigned int
REMOVEFILE_STATE_CONFIRM_CALLBACK1removefile_callback_t
REMOVEFILE_STATE_CONFIRM_CONTEXT2void*
REMOVEFILE_STATE_ERROR_CALLBACK3removefile_callback_t
REMOVEFILE_STATE_ERROR_CONTEXT4void*
REMOVEFILE_STATE_ERRNO5int (read-only)
REMOVEFILE_STATE_STATUS_CALLBACK6removefile_callback_t
REMOVEFILE_STATE_STATUS_CONTEXT7void*
REMOVEFILE_STATE_FTSENT8FTSENT*

typedefremovefile_callback_t

typedef int (*removefile_callback_t)(removefile_state_t state, const char *__unsafe_indexable path, void* context)

enum(anonymous)

Callback return values
underlying type unsigned int
REMOVEFILE_PROCEED0
REMOVEFILE_SKIP1
REMOVEFILE_STOP2

functionremovefile

int removefile(
	const char *__unsafe_indexable path,
	removefile_state_t state,
	removefile_flags_t flags
)

functionremovefileat

int removefileat(
	int fd,
	const char *__unsafe_indexable path,
	removefile_state_t state,
	removefile_flags_t flags
)

functionremovefile_cancel

int removefile_cancel(removefile_state_t state)