s3_file_stream_in streams in AWS S3 file as a raw vector

s3_file_stream_out streams raw vector out to AWS S3 file

s3_file_stream_in(path, ...)

s3_file_stream_out(
  obj,
  path,
  max_batch = fs_bytes("100MB"),
  overwrite = FALSE,
  ...
)

Arguments

path

(character): A character vector of paths or s3 uri

...

parameters to be passed to s3_get_object and s3_put_object

obj

(raw|character): A raw vector, rawConnection, url to be streamed up to AWS S3.

max_batch

(fs_bytes): Maximum batch size being uploaded with each multipart.

overwrite

(logical): Overwrite files if the exist. If this is FALSE and the file exists an error will be thrown.

Value

list of raw vectors containing the contents of the file

Examples

if (FALSE) {
# Require AWS S3 credentials

obj = list(charToRaw("contents1"), charToRaw("contents2"))

dir = s3_file_temp(tmp_dir = "MyBucket")
path = s3_path(dir, letters[1:2], ext = "txt")

s3_file_stream_out(obj, path)
s3_file_stream_in(path)
}