Description Usage Arguments Details Value References See Also Examples
Check if an object from an S3 bucket exists. To retrieve the object, see get_object
1 2 3 4 5 | head_object(object, bucket, ...)
object_exists(object, bucket, ...)
object_size(object, bucket, ...)
|
object |
Character string with the object key, or an object of class “s3_object”. In most cases, if |
bucket |
Character string with the name of the bucket, or an object of class “s3_bucket”. |
... |
Additional arguments passed to |
head_object
is a low-level API wrapper that checks whether an object exists by executing an HTTP HEAD request; this can be useful for checking object headers such as “content-length” or “content-type”. object_exists
is sugar that returns only the logical.
object_size
returns the size of the object (from the “content-length” attribute returned by head_object
).
head_object
returns a logical. object_exists
returns TRUE
if bucket exists and is accessible, else FALSE
. object_size
returns an integer, which is NA
if the request fails.
API Documentation: HEAD Object
bucket_exists
, get_object
, put_object
, delete_object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
# get an object in memory
## create bucket
b <- put_bucket("myexamplebucket")
## save a dataset to the bucket
s3save(mtcars, bucket = b, object = "mtcars")
# check that object exists
object_exists("mtcars", "myexamplebucket")
object_exists("s3://myexamplebucket/mtcars")
# get the object's size
object_size("s3://myexamplebucket/mtcars")
# get the object
get_object("s3://myexamplebucket/mtcars")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.