R/file_exists.R

Defines functions file_exists

Documented in file_exists

#' Does a File Exist on the Nextcloud Server?
#'
#' @param path path to the file
#' @return \code{TRUE} if the file exists, else \code{FALSE}
#' @export
file_exists <- function(path)
{
  stopifnot(is.character(path), length(path) == 1L)

  basename(path) %in% list_files(dirname(path), silent = TRUE)
}
KWB-R/kwb.nextcloud documentation built on Oct. 16, 2024, 11:18 p.m.