| 503 | } |
| 504 | |
| 505 | Status S3FileSystem::DeleteFile(const string& fname) { |
| 506 | string bucket, object; |
| 507 | TF_RETURN_IF_ERROR(ParseS3Path(fname, false, &bucket, &object)); |
| 508 | |
| 509 | Aws::S3::Model::DeleteObjectRequest deleteObjectRequest; |
| 510 | deleteObjectRequest.WithBucket(bucket.c_str()).WithKey(object.c_str()); |
| 511 | |
| 512 | auto deleteObjectOutcome = |
| 513 | this->GetS3Client()->DeleteObject(deleteObjectRequest); |
| 514 | if (!deleteObjectOutcome.IsSuccess()) { |
| 515 | return errors::Unknown(deleteObjectOutcome.GetError().GetExceptionName(), |
| 516 | ": ", deleteObjectOutcome.GetError().GetMessage()); |
| 517 | } |
| 518 | return Status::OK(); |
| 519 | } |
| 520 | |
| 521 | Status S3FileSystem::CreateDir(const string& dirname) { |
| 522 | string bucket, object; |