R/files.R

#' Check file is empty
#'
#' Check whether the size of the specified file on disk is exactly 0.
#'
#' @param file Character vector of filepath(s) to check.
#' @return Logical vector
#' @export
is_empty <- Vectorize(function(file) {
  base::file.info(file)$size == 0
}, SIMPLIFY = TRUE, USE.NAMES = FALSE)
antoine-sachet/customFunctions documentation built on Sept. 25, 2020, 8:56 p.m.