mxnet
Public Member Functions | Static Public Member Functions | List of all members
dmlc::io::FileSystem Class Referenceabstract

file system system interface More...

#include <io.h>

Collaboration diagram for dmlc::io::FileSystem:
Collaboration graph

Public Member Functions

virtual ~FileSystem ()
 virtual destructor More...
 
virtual FileInfo GetPathInfo (const URI &path)=0
 get information about a path More...
 
virtual void ListDirectory (const URI &path, std::vector< FileInfo > *out_list)=0
 list files in a directory More...
 
virtual void ListDirectoryRecursive (const URI &path, std::vector< FileInfo > *out_list)
 list files in a directory recursively using ListDirectory More...
 
virtual StreamOpen (const URI &path, const char *const flag, bool allow_null=false)=0
 open a stream More...
 
virtual SeekStreamOpenForRead (const URI &path, bool allow_null=false)=0
 open a seekable stream for read More...
 

Static Public Member Functions

static FileSystemGetInstance (const URI &path)
 get singleton of filesystem instance according to URI More...
 

Detailed Description

file system system interface

Constructor & Destructor Documentation

virtual dmlc::io::FileSystem::~FileSystem ( )
inlinevirtual

virtual destructor

Member Function Documentation

static FileSystem* dmlc::io::FileSystem::GetInstance ( const URI path)
static

get singleton of filesystem instance according to URI

Parameters
pathcan be s3://..., hdfs://..., file://..., empty string(will return local)
Returns
a corresponding filesystem, report error if we cannot find a matching system
virtual FileInfo dmlc::io::FileSystem::GetPathInfo ( const URI path)
pure virtual

get information about a path

Parameters
paththe path to the file
Returns
the information about the file
virtual void dmlc::io::FileSystem::ListDirectory ( const URI path,
std::vector< FileInfo > *  out_list 
)
pure virtual

list files in a directory

Parameters
pathto the file
out_listthe output information about the files
virtual void dmlc::io::FileSystem::ListDirectoryRecursive ( const URI path,
std::vector< FileInfo > *  out_list 
)
virtual

list files in a directory recursively using ListDirectory

Parameters
pathto the file
out_listthe output information about the files
virtual Stream* dmlc::io::FileSystem::Open ( const URI path,
const char *const  flag,
bool  allow_null = false 
)
pure virtual

open a stream

Parameters
pathpath to file
flagcan be "w", "r", "a
allow_nullwhether NULL can be returned, or directly report error
Returns
the created stream, can be NULL when allow_null == true and file do not exist
virtual SeekStream* dmlc::io::FileSystem::OpenForRead ( const URI path,
bool  allow_null = false 
)
pure virtual

open a seekable stream for read

Parameters
paththe path to the file
allow_nullwhether NULL can be returned, or directly report error
Returns
the created stream, can be NULL when allow_null == true and file do not exist

The documentation for this class was generated from the following file: