attachment_data | R Documentation |
Gets the attachments of a single bug or any single attachment selected by its ID. By default, the R bug tracker is queried.
attachment_data( bug_id, attachment_id = NULL, obsolete = FALSE, patch_only = FALSE, output_dir = NULL, output_file = NULL, base_url = "https://bugs.r-project.org/bugzilla3/rest/bug/" )
bug_id |
ID of one bug (numeric or |
attachment_id |
Optional ID of one attachment (numeric or
|
obsolete |
Return information about attachments marked as obsolete?
A |
patch_only |
Only return information about files marked as a patch?
A |
output_dir |
file system directory where attachments will be saved
( |
output_file |
name of file where the attachment will be saved
( |
base_url |
URL to Bugzilla REST API (bug history). Defaults to R Bugzilla. |
If output_dir
or output_file
is specified, the function
writes to the file system and invisibly returns the output_dir
or
output_file
parameter (the one that is actually used). Otherwise
returns a list
containing the attachments as either
raw
vectors or character
strings, depending on the
file type. The list
has the following vector attributes with one
item corresponding to each attachment:
"file_name" |
Name of file ( |
"is_patch" |
Is the file marked as a patch? ( |
"content_type" |
MIME type of file ( |
## Not run: # Get attachments related to a bug data17398b <- attachment_data(17398) # Get a single attachment data2328a <- attachment_data(attachment_id = 2328) # Save files to a temporary directory dir17148 <- attachment_data(17148, output_dir = tempfile(pattern = "dir")) unlink(dir17148, recursive = TRUE) # With and without obsolete files (different code paths used) data16895b2 <- attachment_data(16895, obsolete = TRUE) data16895b <- attachment_data(16895) all(data16895b %in% data16895b2) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.