批处理删除文件夹
try {
FileSystem.deleteDirectory(this._nativePath);
} catch(e:Dynamic) {
switch(Sys.systemName()) {
case 'Windows':
Sys.command('rd /s/q ${this._nativePath}');
case 'Mac':
Sys.command('rm ${this._nativePath}');
}
}
this._nativePath 文件路径
public function deleteFile():Void {
try{
FileSystem.deleteFile(this._nativePath);
}catch(e:Dynamic) {
switch(Sys.systemName()) {//平台标识
case 'Windows':
Sys.command('del/f/s/q ${this._nativePath}');
case 'Mac':
Sys.command('rm -r ${this._nativePath}');
}
}
}