MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / DeleteFile

Method DeleteFile

tensorflow/core/platform/cloud/gcs_file_system.cc:1527–1541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1525}
1526
1527Status GcsFileSystem::DeleteFile(const string& fname) {
1528 string bucket, object;
1529 TF_RETURN_IF_ERROR(ParseGcsPath(fname, false, &bucket, &object));
1530
1531 std::unique_ptr<HttpRequest> request;
1532 TF_RETURN_IF_ERROR(CreateHttpRequest(&request));
1533 request->SetUri(strings::StrCat(kGcsUriBase, "b/", bucket, "/o/",
1534 request->EscapeString(object)));
1535 request->SetTimeouts(timeouts_.connect, timeouts_.idle, timeouts_.metadata);
1536 request->SetDeleteRequest();
1537
1538 TF_RETURN_WITH_CONTEXT_IF_ERROR(request->Send(), " when deleting ", fname);
1539 ClearFileCaches(fname);
1540 return Status::OK();
1541}
1542
1543Status GcsFileSystem::CreateDir(const string& dirname) {
1544 string bucket, object;

Callers 1

TESTFunction · 0.45

Calls 7

ParseGcsPathFunction · 0.85
StrCatFunction · 0.50
SetUriMethod · 0.45
EscapeStringMethod · 0.45
SetTimeoutsMethod · 0.45
SetDeleteRequestMethod · 0.45
SendMethod · 0.45

Tested by 1

TESTFunction · 0.36