PHP Class Cml\Vendor\File

Show file Open project: linhecheng/cmlphp

Public Methods

Method Description
copyFile ( string $filename, string $newfilename ) : boolean 拷贝一个新文件
createDir ( string $path ) : boolean 创建目录
createFile ( string $filename ) : mixed 创建空文件
delDir ( string $path ) : boolean 删除目录
delFile ( string $filename ) : boolean 删除文件
getFileInfo ( string $filename ) : boolean | array 获取文件信息
moveFile ( string $filename, string $newfilename ) : boolean 移动文件
writeFile ( string $filename, string $content, integer $type = 1 ) : boolean 写文件

Method Details

copyFile() public static method

拷贝一个新文件
public static copyFile ( string $filename, string $newfilename ) : boolean
$filename string 文件名称
$newfilename string 新文件名称
return boolean

createDir() public static method

创建目录
public static createDir ( string $path ) : boolean
$path string 目录
return boolean

createFile() public static method

创建空文件
public static createFile ( string $filename ) : mixed
$filename string 需要创建的文件
return mixed

delDir() public static method

删除目录
public static delDir ( string $path ) : boolean
$path string 目录
return boolean

delFile() public static method

删除文件
public static delFile ( string $filename ) : boolean
$filename string 文件名称
return boolean

getFileInfo() public static method

获取文件信息
public static getFileInfo ( string $filename ) : boolean | array
$filename string 文件名称
return boolean | array | array ['上次访问时间','inode 修改时间','取得文件修改时间','大小','类型']

moveFile() public static method

移动文件
public static moveFile ( string $filename, string $newfilename ) : boolean
$filename string 文件名称
$newfilename string 新文件名称
return boolean

writeFile() public static method

写文件
public static writeFile ( string $filename, string $content, integer $type = 1 ) : boolean
$filename string 文件名称
$content string 写入文件的内容
$type integer 类型,1=清空文件内容,写入新内容,2=再内容后街上新内容
return boolean