createPlaceholderLink.Rd
Create a placeholder file that links to an ArtifactDB ID.
This is by initializeUpload
to automatically create deduplicating links.
createPlaceholderLink(dir, path, id)
extractLinkedID(dir, path)
String containing the path to the project directory.
String containing the relative path of the file in dir
to be linked from.
String containing the ArtifactDB identifier of the file to be linked to.
For createLink
, a symbolic link is created at path
inside dir
, with the id
string embedded in the name of the destination file.
NULL
is invisibly returned.
For extractLinkID
, a string is returned containing the ArtifactDB identifier used to create the link.
The placeholder is implemented as a dangling symlink where the id
is embedded into the destination path.
This distinguishes the placeholders from regular files and non-broken symlinks to existing targets,
allowing initializeUpload
to safely assume that the placeholder represents a link to an ArtifactDB resource.
initializeUpload
, where the placeholders are automatically detected for linking.
tmp <- tempfile()
dir.create(tmp)
createPlaceholderLink(tmp, "boo.txt", example.id)
list.files(tmp)
#> [1] "boo.txt"
extractLinkedID(tmp, "boo.txt")
#> [1] "test-public:blah.txt@base"