diff --git a/tensorflow/c/env.cc b/tensorflow/c/env.cc index 3d490d95e66..43879a18359 100644 --- a/tensorflow/c/env.cc +++ b/tensorflow/c/env.cc @@ -18,6 +18,7 @@ limitations under the License. #include "tensorflow/c/c_api_internal.h" #include "tensorflow/c/tf_status_helper.h" #include "tensorflow/core/platform/env.h" +#include "tensorflow/core/platform/path.h" #include "tensorflow/core/platform/types.h" struct TF_StringStream { @@ -148,9 +149,9 @@ TF_StringStream* TF_GetLocalTempDirectories() { void TF_GetTempFileName(const char* extension, std::string* name, TF_Status* status) { - *name = ::tensorflow::Env::Default()->GetTempFilename(extension); - if (*name.length() == 0) { - TF_SetStatus(status, TF_INTERNAL, "Can not create temp file name"); + *name = ::tensorflow::io::GetTempFilename(extension); + if (name->length() == 0) { + TF_SetStatus(status, TF_INTERNAL, "Can not get temp file name"); } else { TF_SetStatus(status, TF_OK, ""); } diff --git a/tensorflow/c/env.h b/tensorflow/c/env.h index b50d0fdec03..273a3b5e142 100644 --- a/tensorflow/c/env.h +++ b/tensorflow/c/env.h @@ -20,6 +20,8 @@ limitations under the License. #include #include +#include + #include "tensorflow/c/c_api.h" #include "tensorflow/c/tf_file_statistics.h"