createLink | R Documentation |
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.
## Default S3 method:
createLink(link=".", target, skip=!overwrite, overwrite=FALSE,
methods=getOption("createLink/args/methods", c("unix-symlink", "windows-ntfs-symlink",
"windows-shortcut")), ...)
link |
The path or pathname of the link to be created.
If |
target |
The target file or directory to which the shortcut should point to. |
skip |
If |
overwrite |
If |
methods |
A |
... |
Not used. |
Returns (invisibly) the path or pathname to the link.
If no link was created, NULL
is returned.
In order for method="unix-symlink"
(utilizing
file.symlink()
),
method="windows-ntfs-symlink"
(utilizing executable mklink
),
and/or method="windows-shortcut"
(utilizing
createWindowsShortcut
()) to succeed on Windows,
the client/R session must run with sufficient privileges
(it has been reported that Administrative rights are necessary).
Henrik Bengtsson
Ben Garrett, Windows File Junctions, Symbolic Links and Hard Links,
September 2009 [https://devtidbits.com/2009/09/07/windows-file-junctions-symbolic-links-and-hard-links/]
createWindowsShortcut
() and
file.symlink()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.