deregister.RdRemove a directory on the shared filesystem from the search index. This assumes that either the directory does not exist, or that the directory is world-readable and the caller has write access to it.
deregister(dir, url, retry = 3, wait = 1, block = TRUE)On success, the directory is deregistered and NULL is invisibly returned.
If block=FALSE, the function returns before confirmation of successful deregistration from the SewerRat API.
This can be useful for asynchronous processing of directories with many files.
# Start up an example SewerRat service:
info <- startSewerRat()
#> Warning: cannot rename file '/tmp/RtmpUMJYND/file1ce4c3390f7' to '/github/home/.local/share/R/SewerRat/SewerRat-linux-amd641.3.1', reason 'Invalid cross-device link'
tmp <- tempfile()
dir.create(tmp)
write(file=file.path(tmp, "whee.json"), '{ "foo": "bar" }')
register(tmp, "whee.json", url=info$url)
query("bar", url=info$url)
#> [[1]]
#> [[1]]$path
#> [1] "/tmp/RtmpUMJYND/file1ce3e257a1/whee.json"
#>
#> [[1]]$user
#> [1] "root"
#>
#> [[1]]$time
#> [1] 1755293393
#>
#> [[1]]$metadata
#> [[1]]$metadata$foo
#> [1] "bar"
#>
#>
#>
# After deregistration, the files cannot be queried.
deregister(tmp, url=info$url)
query("bar", url=info$url)
#> list()