cloudyr / aws.s3

Amazon Simple Storage Service (S3) API Client
https://cloud.r-project.org/package=aws.s3
381 stars 148 forks source link

aws s3 mv correlate function #278

Open LiNk-NY opened 5 years ago

LiNk-NY commented 5 years ago

Hi Thomas, @leeper Perhaps you can export a function that is similar to what aws s3 mv does. https://docs.aws.amazon.com/cli/latest/reference/s3/mv.html

Please specify whether your issue is about:

If there is no comparable API query, it could be the combination of copy_object and delete_object.

## load package
library("aws.s3")

## code goes here
mv_object <- function(from_object, to_object, from_bucket, to_bucket, headers = list(), ...) {
    copy_object(from_object = from_object, to_object = to_object, from_bucket = from_bucket,
         to_bucket = to_bucket, headers = headers, ...)
    message("Removing object in: ", file.path(from_bucket, from_object))
    delete_object(object = from_object, bucket = from_bucket)
}

Best regards, Marcel

abelcastilloavant commented 5 years ago

Tagging @acolum since it seems that they are the current maintainer.

acolum commented 5 years ago

Thanks @abelcastilloavant for tagging me.

@LiNk-NY , I'm a bit busy this week, but I hope to resolve your issue soon.

LiNk-NY commented 5 years ago

Any updates on this? @acolum Thanks :)