R/get_plinkr_tempfilename.R

Defines functions get_plinkr_tempfilename

Documented in get_plinkr_tempfilename

#' Get a temporary filename
#'
#' Get a temporary filename, similar to \link{tempfile},
#' except that it always writes to a temporary folder
#' named \link{plinkr}.
#' @note this function is added to make sure no temporary
#' cache files are left undeleted
#' @param pattern	a non-empty character vector
#'   giving the initial part of the name.
#' @param fileext	a non-empty character vector
#'   giving the file extension
#' @return name for a temporary file
#' @export
get_plinkr_tempfilename <- function(
  pattern = "file",
  fileext = ""
) {
  normalizePath(
    tempfile(
      pattern = pattern,
      tmpdir = plinkr::get_plinkr_folder(),
      fileext = fileext
    ),
    mustWork = FALSE
  )
}
richelbilderbeek/plinkr documentation built on March 25, 2024, 3:18 p.m.