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

Function GetTmpFilename

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

TODO: DO NOT use a hardcoded path

Source from the content-addressed store, hash-verified

131
132// TODO: DO NOT use a hardcoded path
133Status GetTmpFilename(string* filename) {
134#ifndef _WIN32
135 char buffer[] = "/tmp/gcs_filesystem_XXXXXX";
136 int fd = mkstemp(buffer);
137 if (fd < 0) {
138 return errors::Internal("Failed to create a temporary file.");
139 }
140 close(fd);
141#else
142 char buffer[] = "/tmp/gcs_filesystem_XXXXXX";
143 char* ret = _mktemp(buffer);
144 if (ret == nullptr) {
145 return errors::Internal("Failed to create a temporary file.");
146 }
147#endif
148 *filename = buffer;
149 return Status::OK();
150}
151
152/// \brief Splits a GCS path to a bucket and an object.
153///

Callers 2

GcsWritableFileMethod · 0.85
NewAppendableFileMethod · 0.85

Calls 1

InternalFunction · 0.85

Tested by

no test coverage detected