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, block = TRUE)

Arguments

dir

String containing the path to the directory to be deregistered. This may be a relative or absolute path.

url

String containing the URL to the SewerRat REST API.

retry, wait

Deprecated arguments, ignored.

block

Logical scalar indicating whether to block on successful registration.

Value

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.

Author

Aaron Lun

Examples

# 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()