Skip to content

Commit

Permalink
document getLinkFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-sauer committed May 3, 2024
1 parent 22ebf79 commit f2e3b2e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions R/getLinkFunction.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#' getLinkFunction
#'
#' Returns a function that symlinks, hardlinks, or copies files and
#' directories, depending on OS capabilities.
#' Returns a function that creates a symlink, hardlink, junction, or copy of
#' files and directories, depending on OS capabilities (usually symlinks are
#' not supported on Windows).
#'
#' @return A function with arguments "from" and "to" which should behave like
#' file.symlink on all platforms.
#' @author Pascal Sauer
#' @export
getLinkFunction <- function() {
# try symlinks, if they don't work (Windows) fall back to hardlinks/junctions/copying

withr::local_dir(withr::local_tempdir())

writeLines("a", "a")
Expand Down

0 comments on commit f2e3b2e

Please sign in to comment.