【发布时间】:2012-06-12 01:28:45
【问题描述】:
文件复制错误,详细信息:
2012-06-12 09:21:38.557 mead_debug[10314:fb03] [INFO] parent_entry := /Users/laiqinyi/Library/Application Support/iPhone Simulator/4.3.2/Applications/5EFBD6D1-66EB-4DEC- 8AE7-D386729744E9/Documents/dest/
2012-06-12 09:22:34.640 mead_debug[10314:fb03] [INFO] 上传错误源未定义
2012-06-12 09:22:34.641 mead_debug[10314:fb03] [INFO] 上传错误目标未定义
我按照 API 说明进行操作,不认为这个“copyTo”代码有什么问题。
此外,还有文件夹“Documents/dest”和文件“Documents/readme.txt”
http://docs.phonegap.com/en/1.8.0/cordova_file_file.md.html#File
**var FileSystem = {
copy : function(src, dest){
var parentEntry = new DirectoryEntry({fullPath:("/dest")});
console.log("parent_entry := " + FileSystem.root_path+"/dest");
function gotFS(fileSystem) {
fileSystem.root.getFile("readme.txt", null, gotFileEntry, fail);
}
function gotFileEntry(fileEntry) {
fileEntry.copyTo(parentEntry, "file.copy", function(e){console.log("copy okay");}, fail);
}
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
}
}**
【问题讨论】: