logger.validate.file {RnBeads} | R Documentation |
Validates the specified file or directory exists. Prints an error or a warning message to the log if it does not exist, it is not of the accepted type or is not accessible.
logger.validate.file(file, is.file = TRUE, terminate = TRUE)
file |
Name of file or directory to validate. |
is.file |
Flag indicating if the given name must denote an existing file. If this is |
terminate |
Flag indicating if the execution is to be terminated in case the validation fails. This parameter
determines if an error message ( |
Whether the validation succeeded or not, invisibly. Note that when terminate
is TRUE
and the
validation fails, the R session is closed and thus no value is returned.
Yassen Assenov
if (!logger.isinitialized()) logger.start(fname = NA) # Validate the current working directory exists logger.validate.file(getwd(), FALSE)