@@ -24,6 +24,7 @@ limitations under the License.
2424#include " tensorflow/core/lib/io/path.h"
2525#include " tensorflow/core/lib/io/match.h"
2626#include " tensorflow/core/platform/env.h"
27+ #include " tensorflow/core/platform/file_statistics.h"
2728#include " tensorflow/core/protobuf/meta_graph.pb.h"
2829%}
2930
@@ -143,6 +144,17 @@ bool IsDirectory(const string& dirname, TF_Status* out_status) {
143144 }
144145 return false ;
145146}
147+
148+ using tensorflow::FileStatistics;
149+
150+ void Stat (const string& filename, FileStatistics* stats,
151+ TF_Status* out_status) {
152+ tensorflow::Status status = tensorflow::Env::Default ()->Stat (filename,
153+ stats);
154+ if (!status.ok ()) {
155+ Set_TF_Status_from_Status (out_status, status);
156+ }
157+ }
146158%}
147159
148160// Wrap the above functions.
@@ -160,5 +172,8 @@ void RenameFile(const string& oldname, const string& newname, bool overwrite,
160172 TF_Status* out_status);
161173void DeleteRecursively (const string& dirname, TF_Status* out_status);
162174bool IsDirectory (const string& dirname, TF_Status* out_status);
175+ void Stat (const string& filename, tensorflow::FileStatistics* stats,
176+ TF_Status* out_status);
163177
164178%include " tensorflow/core/lib/io/path.h"
179+ %include " tensorflow/core/platform/file_statistics.h"
0 commit comments