Skip to contents

This function unlinks (deletes) files at the specified paths. It does not remove directories. If the missing_ok argument is set to FALSE, it checks if the files exist before attempting to unlink them. Similar to Python's pathlib.Path.unlink() method.

Usage

Path_unlink(paths, missing_ok = FALSE)

Arguments

paths

A character vector of file paths to unlink.

missing_ok

Logical. If TRUE, allow unlinking of non-existent files.

Examples

if (FALSE) {
Path_unlink("file.txt")
}