一、gfile模块:对文件进行操作
defined in tensorflow/python/lib/io/file_io.py
二:相关函数:
功能:从旧地址拷贝到新地址(Copies data from oldpath to newpath)
功能:以递归的方式删除dirname下的所有内容(Deletes everything under the dirname recursively)
功能:确定路径是否存在(Determines whether a path exists or not)
功能:返回与给定模式匹配的文件列表(Returns a list of files that match the given pattern(s))
功能:返回路径是否是目录(Returns whether the path is a directory or not)
功能:返回目录中包含的条目列表。该列表按任意顺序排列。它不包含特殊条目'.' and '..'。(Returns a list of entries contained a directory)
returns: [filename1, filename2, ..., filenameN] as strings
功能:创建目录和所有父/中间目录。如果dirname已存在且可写,则成功(Creates a directory and all parent/intermediate directories)
功能:创建名为dirname的目录(Creates a directory with the name 'dirname')
和MakeDirs却别:MakeDirs是创建一连串的目录比如/data/sub1/;MkDir则是创建一个目录,比如/data/
功能:删除位于'filename'的文件(Deletes the file located at 'filename')
功能:重命名或移动文件/目录(Rename or move a file / dirctory)
· overwrite: boolean,如果为False,则newname被现有文件占用是错误的(boolean, if false it is an error for newname to be occupied by an exiting file)
功能:返回给定路径的文件统计信息(Returns file statistics for a given path)
Returns: FileStatistics 结构,包含有关路径信息(FileStatistics struct that contains information about the path)
功能:目录的递归目录生成器(Recursive directory tree generator for directories)
Args:
· top:string,a Nirectory name
· in_order:bool, Traverse(遍历) in order if True, post order if False