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
recursiveisFalse, aFile_Error.Directory_Not_Emptyerror is thrown. - If the bucket does not exist, an
S3_Bucket_Not_Founderror is thrown. - If the access to the object is forbidden, an
S3_Error.Access_Deniederror is thrown. - If the Output operations are disabled, a
Forbidden_Operationpanic will occur.