R/util_hide_file_windows.R

Defines functions util_hide_file_windows

Documented in util_hide_file_windows

#' If on Windows, hide a file
#'
#' @param fn the file path + name
#'
#' @return `invisible(NULL)`
#'
#' @keywords internal
util_hide_file_windows <- function(fn) {
  if (.Platform$OS.type != "windows") return();
  fn <- normalizePath(fn)
  if (file.exists(fn)) {
    system(sprintf("attrib +h %s", shQuote(fn, type = "cmd")))
  }
  invisible(NULL)
}

Try the dataquieR package in your browser

Any scripts or data that you put into this service are public.

dataquieR documentation built on May 29, 2024, 7:18 a.m.