cctools
unlink_recursive.h File Reference
#include "compat-at.h"
#include <fcntl.h>

Go to the source code of this file.

Functions

int unlinkat_recursive (int fd, const char *path)
 Delete a path recursively. More...
 
int unlink_recursive (const char *path)
 Delete a path recursively. More...
 
int unlink_dir_contents (const char *path)
 Unlink only the contents of the directory recursively. More...
 

Detailed Description

Unlink recursively.

Function Documentation

◆ unlinkat_recursive()

int unlinkat_recursive ( int  fd,
const char *  path 
)

Delete a path recursively.

Parameters
fdOpen directory.
pathThe path relative to the open directory fd to unlink recursively.
Returns
0 on success, -1 on failure.

◆ unlink_recursive()

int unlink_recursive ( const char *  path)

Delete a path recursively.

Parameters
pathThe path to unlink recursively.
Returns
0 on success, -1 on failure.

◆ unlink_dir_contents()

int unlink_dir_contents ( const char *  path)

Unlink only the contents of the directory recursively.

Parameters
pathThe path of the directory.
Returns
0 on success, -1 on failure.