deregister.Rd
Remove 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)
On success, the directory is deregistered and NULL is invisibly returned.
# Start up an example SewerRat service:
info <- startSewerRat()
#> Warning: cannot rename file '/tmp/RtmpJDU5Vu/file21742abee22' to '/github/home/.local/share/R/SewerRat/SewerRat-linux-amd641.0.9', 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/RtmpJDU5Vu/file217598be89a/whee.json"
#>
#> [[1]]$user
#> [1] "root"
#>
#> [[1]]$time
#> [1] 1727971507
#>
#> [[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()