createLink
From R.utils v1.26.2
by Henrik Bengtsson
Creates a link to a file or a directory
Creates a link to a file or a directory. This method tries to create a link to a file/directory on the file system, e.g. a symbolic link and Windows Shortcut links. It depends on operating and file system (and argument settings), which type of link is finally created, but all this is hidden internally so that links can be created the same way regardless of system.
Usage
## S3 method for class 'default':
createLink(link=".", target, skip=!overwrite, overwrite=FALSE,
methods=getOption("createLink/args/methods", c("unix-symlink", "windows-ntfs-symlink",
"windows-shortcut")), ...)
Arguments
- link
- The path or pathname of the link to be created.
If
"."
(orNULL
), it is inferred from thetarget
argument, if possible. - target
- The target file or directory to which the shortcut should point to.
- skip
- If
TRUE
and a file with the same name as argumentlink
already exists, then the nothing is done. - overwrite
- If
TRUE
, an existing link file is overwritten, otherwise not. - methods
- A
character
vector
specifying what methods (and in what order) should be tried for creating links. - ...
- Not used.
Value
- Returns (invisibly) the path or pathname to the destination.
References
Ben Garrett, Windows File Junctions, Symbolic Links and Hard Links,
September 2009 [
See Also
createWindowsShortcut
() and
file.symlink()
Community examples
Looks like there are no examples yet.