Adobe AIR copyto

时间:2010-12-15 18:08:43

标签: air

我正在尝试将文件从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.
    }
}

1 个答案:

答案 0 :(得分:2)

files[f].moveTo(targetFile,true); // Overwrite