This is an abstract class.

#include <env.h>

An interface used by the tensorflow implementation to access operating system functionality like the filesystem etc.


Callers may wish to provide a custom Env object to get fine grain control.

All Env implementations are safe for concurrent access from multiple threads without any external synchronization.


Direct Known Subclasses:tensorflow::EnvWrapper

Constructors and Destructors


Public functions

CreateDir(const string & dirname)
Creates the specified directory.
DeleteDir(const string & dirname)
Deletes the specified directory.
DeleteFile(const string & fname)
Deletes the named file.
DeleteRecursively(const string & dirname, int64 *undeleted_files, int64 *undeleted_dirs)
Deletes the specified directory and all subdirectories and files underneath it.
FileExists(const string & fname)
Returns OK if the named path exists and NOT_FOUND otherwise.
FilesExist(const std::vector< string > & files, std::vector< Status > *status)
Returns true if all the listed files exist, false otherwise.
FormatLibraryFileName(const string & name, const string & version)=0
virtual string
GetChildren(const string & dir, std::vector< string > *result)
Stores in *result the names of the children of the specified directory.
Returns the absolute path of the current executable.
GetFileSize(const string & fname, uint64 *file_size)
Stores the size of fname in *file_size.
GetFileSystemForFile(const string & fname, FileSystem **result)
virtual Status
Returns the FileSystem object to handle operations on the file specified by 'fname'.
GetMatchingPaths(const string & pattern, std::vector< string > *results)
virtual Status
Given a pattern, stores in *results the set of paths that matches that pattern.
GetRegisteredFileSystemSchemes(std::vector< string > *schemes)
virtual Status
Returns the file system schemes registered for this Env.
GetSymbolFromLibrary(void *handle, const char *symbol_name, void **symbol)=0
virtual Status
IsDirectory(const string & fname)
Returns whether the given path is a directory or not.
LoadLibrary(const char *library_filename, void **handle)=0