S3_File.delete_if_exists
delete_if_existsrecursive
Documentation
Deletes the file if it had existed.
Arguments
recursive
: If the target is a non-empty directory, it will only be removed if this is set toTrue
. Defaults toFalse
, meaning that the operation will fail if the directory is not empty. This option has no effect for files or data links.
Errors
- If the target is a directory and
recursive
isFalse
, aFile_Error.Directory_Not_Empty
error is thrown. - If the bucket does not exist, an
S3_Bucket_Not_Found
error is thrown. - If the access to the object is forbidden, an
S3_Error.Access_Denied
error is thrown. - If the Output operations are disabled, a
Forbidden_Operation
panic will occur.