delete_object - always returns TRUE
hello -
the delete_object always returns true even if the file doesn't exist in the provided s3 bucket. there is no status_code returned so no way to determine if the operation succeeded.
i would appreciate your thoughts on any other ways to determine success of the operation.
@vsrdharca does it make sense for your use case to use the exists function before and after your delete operation in your code to determine success of the delete operation?
That won't necessarily work in all cases.
For example, you could be running under credentials that are able to read but not delete. In this scenario, object_exists will return TRUE, delete_object will also return TRUE (because it always does), but the object will not in fact be deleted.
EDIT: just noticing that you suggested checking objects_exists after as well as before - that would indeed work around the scenario I proposed. Clumsy, but it'd work.