我正在尝试将文件从myLocation移动到桌面,但我的copyTo语法错误:
var myLocation = new air.File(myVolume);
var files = myLocation.getDirectoryListing();
for (var f=0; f < files.length; f++){
if (!files[f].isDirectory) {
targetFile = air.File.desktopDirectory.resolvePath(files[f].name);
files[f].copyTo(targetFile); // This line doesn't work.
}
}
答案 0 :(得分:2)
files[f].moveTo(targetFile,true); // Overwrite