diff options
author | Jonathan Hseu <jhseu@google.com> | 2016-11-04 11:53:50 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-11-04 13:05:51 -0700 |
commit | 879e0accd1c833771c8058d3eb5f2d4f06f895d4 (patch) | |
tree | 81635e1bd758cd8a8e5ec760db70fc72f6480c66 /tensorflow/stream_executor/lib | |
parent | a2c8e99777cc0b961fb42106af5bd527a43e76f7 (diff) |
Change FileExists to return tensorflow::Status.
Also done separately by @llhe at github.com/tensorflow/tensorflow/pull/5370. We needed to do this change internally to fix all callers.
Motivation: The existing FileExists interface doesn't allow callers to distinguish between file not found vs. filesystem errors.
Semantics changes:
- gfile.Exists in Python now throws an exception for filesystem errors. It continues to return true/false if it can accurately determine whether a file exists.
- RecursivelyCreateDir now returns errors for filesystem errors when calling FileExists.
Change: 138224013
Diffstat (limited to 'tensorflow/stream_executor/lib')
-rw-r--r-- | tensorflow/stream_executor/lib/env.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/stream_executor/lib/env.h b/tensorflow/stream_executor/lib/env.h index 068fe7936f..f11a4cb25b 100644 --- a/tensorflow/stream_executor/lib/env.h +++ b/tensorflow/stream_executor/lib/env.h @@ -29,11 +29,11 @@ using tensorflow::ReadFileToString; using tensorflow::Thread; using tensorflow::WriteStringToFile; -inline bool FileExists(const string& filename) { +inline Status FileExists(const string& filename) { return Env::Default()->FileExists(filename); } -inline bool FileExists(const port::StringPiece& filename) { +inline Status FileExists(const port::StringPiece& filename) { return Env::Default()->FileExists(filename.ToString()); } |