Description Usage Arguments Author(s) References See Also Examples
Locks file system ressource if it is not locked yet, else tries try_limit
times to lock it after it it has been made available again. If try_limt
is reached, either FALSE
is returned or an error is thrown
(depends on strict
).
1 | tryLockRessource(path, try_limit = 100, strict = FALSE, ...)
|
path |
Signature argument. Object containing file system path information. |
try_limit |
|
strict |
|
... |
Further arguments passed to subsequent functions/methods.
In particular:
|
Janko Thyson janko.thyson@rappster.de
https://github.com/Rappster/filesystr
tryLockRessource-character-method
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
## Example content //
path <- file.path(tempdir(), "test/registry.rdata")
file.create(path)
## File //
lockRessource(path = path)
tryLockRessource(path = path, try_limit = 3)
try(tryLockRessource(path = path, try_limit = 3, strict = TRUE))
unlockRessource(path = path)
tryLockRessource(path = path)
unlockRessource(path = path)
## Directory //
path <- dirname(path)
lockRessource(path = path)
tryLockRessource(path = path, try_limit = 3)
try(tryLockRessource(path = path, try_limit = 3, strict = TRUE))
unlockRessource(path = path)
tryLockRessource(path = path)
unlockRessource(path = path)
## Non-existing ressource //
expect_error(tryLockRessource(path = "abcd", strict = TRUE))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.