On Windows and Mac, nsIFile.copyTo will fail if the file already exists. Use the .createUnique logic to create a unique name, but then remove it for the copy.

This commit is contained in:
Benjamin Smedberg 2010-06-29 23:24:09 -04:00
parent ae3fe7f334
commit bdb05f2495

View File

@ -22,6 +22,7 @@ function copyToTemporaryFile(f)
tmpf = tmpd.clone();
tmpf.append("temp.manifest");
tmpf.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0600);
tmpf.remove(false);
f.copyTo(tmpd, tmpf.leafName);
return tmpf;