FileUtil.DeleteFileOrDirectory 删除文件或文件夹

static function DeleteFileOrDirectory (path : string) : bool

Description描述

Deletes a file or a directory given a path.

删除给定路径的文件或者文件夹。

This function's path is relative to the project root folder but it can also accept absolute paths.

这个方法可以使用相对路径也可以使用那个绝对路径

All file separators should be forward ones "/" (Unix style).

所有的文件目录分隔符必须使用“/”格式(Unix 风格)

// creates a menu entry to remove a file or a directory.
//创建一个菜单项,来删除文件或文件夹
@MenuItem ("Example/Remove Something")
static function RemoveAFile () {
	//removes the file
	//删除文件
	FileUtil.DeleteFileOrDirectory("your/path/to/the/folder/or/file");
}
Page last updated: 2011-5-7