item_rm_files {sbtools} | R Documentation |
Remove files associated with an item
Description
Removes existing files associated with an item.
NOTE: This function will not alter facets which can also
contain facets. To manipulate facets, the facet element of
a sciencebase item must be altered and updated with item_update
.
This function is the key way to remove files attached to SB items.
Usage
item_rm_files(sb_id, files, ...)
Arguments
sb_id |
An |
files |
A character vector of file names to remove. If not supplied, defaults to removing all attached files. |
... |
Additional parameters are passed on to |
Value
An updated object of class sbitem
Examples
## Not run:
res <- item_create(user_id(), "item456")
cat("foo bar", file = "foobar.txt")
item_append_files(res, "foobar.txt")
res <- item_get(res)
res$files[[1]]$name
res2 <- item_rm_files(res)
res2$files
## End(Not run)
[Package sbtools version 1.3.2 Index]