logger.validate.file {RnBeads} | R Documentation

## logger.validate.file

### Description

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.

### Usage

    logger.validate.file(file, is.file = TRUE, terminate = TRUE)

### Arguments

`file` | Name of file or directory to validate.
`is.file` | Flag indicating if the given name must denote an existing file. If this is `FALSE`, the given name must denote a directory. Set this to `NA` if both types are an acceptable scenario.
`terminate` | Flag indicating if the execution is to be terminated in case the validation fails. This parameter determines if an error message (`terminate` is `TRUE`) or a warning message (`terminate` is `FALSE`) is to be sent to the log when the specified file or directory does not exist, is not of the accepted type or is not accessible.

### Value

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.

### Author(s)

Yassen Assenov

### Examples

    if (!logger.isinitialized())
      logger.start(fname = NA)
    # Validate the current working directory exists
    logger.validate.file(getwd(), FALSE)

[Package RnBeads version 1.10.8 Index]