aws_file_delete: Delete a file

View source: R/files.R

aws_file_deleteR Documentation

Delete a file

Description

Delete a file

Usage

aws_file_delete(remote_path, ...)

Arguments

remote_path

(character) one or more remote S3 paths. required

...

named parameters passed on to delete_object

Value

NULL invisibly

See Also

Other files: aws_file_attr(), aws_file_copy(), aws_file_download(), aws_file_exists(), aws_file_rename(), aws_file_upload(), six_file_upload()

Examples


# create a file
bucket <- random_bucket()
aws_bucket_create(bucket)
tfile <- tempfile()
cat("Hello World!\n", file = tfile)
aws_file_upload(path = tfile, remote_path = s3_path(bucket))

# delete the file
aws_file_delete(s3_path(bucket, basename(tfile)))

# file does not exist - no error is raised
aws_file_delete(s3_path(bucket, "TESTING123"))

# Cleanup
six_bucket_delete(bucket, force = TRUE)


sixtyfour documentation built on April 3, 2025, 8:22 p.m.