Learn R Programming

fitPoly (version 4.0.0)

checkFilename: Check if a file can be created

Description

Checks if a file with that name can be created. If successful, any pre-existing file does not exist any more.

Usage

checkFilename(filename, overwrite=TRUE)

Value

TRUE if a new file can be created, else FALSE. If TRUE, no file of that name exists (any more)

Arguments

filename

a file name with or without path. If the name contains a path the entire path must already exist, else the file cannot be created and the result is FALSE.

overwrite

if TRUE an attempt is made to delete any pre-existing file of that name; the function returns FALSE if the file is locked or the user has no rights to delete the file. If FALSE the function returns FALSE if any file of that name already exists, and no attempt is made to remove it