Skip to contents

check_overwrite

Usage

check_overwrite(pathname = pathname, filename = filename, overwrite = FALSE)

Arguments

pathname

character string with valid path to a folder.

filename

character string specifying the name of the file with its extension.

overwrite

logical, see 'Details'.

Value

Nothing.

Examples

# Create a silly example text file.
sink("example.100")
i <- 1:10
outer(i, i)
sink()

# Checks.
check_overwrite("", "example.txt")
check_overwrite("", "example.txt", overwrite = FALSE)
check_overwrite("", "e.txt")

# Remove the silly example text file.
invisible(file.remove("example.100"))