replace existing files with saveBytes(), also look into deployJava.js (issue #650)

This commit is contained in:
benfry
2011-06-21 01:23:49 +00:00
parent 47ae658028
commit c159f0eb04
6 changed files with 53 additions and 18 deletions
+12
View File
@@ -5007,6 +5007,12 @@ public class PApplet extends Applet
bos.close();
bos = null;
if (targetFile.exists()) {
if (!targetFile.delete()) {
System.err.println("Could not replace " +
targetFile.getAbsolutePath() + ".");
}
}
if (!tempFile.renameTo(targetFile)) {
System.err.println("Could not rename temporary file " +
tempFile.getAbsolutePath());
@@ -5058,6 +5064,12 @@ public class PApplet extends Applet
output.close();
output = null;
if (file.exists()) {
if (!file.delete()) {
System.err.println("Could not replace " + file.getAbsolutePath());
}
}
if (!tempFile.renameTo(file)) {
System.err.println("Could not rename temporary file " +
tempFile.getAbsolutePath());
+2
View File
@@ -72,6 +72,8 @@ X decision: add note to reference that the 'c' is a misnomer
X screen.width/screen.height -> screen.width, screenW/H
o needs to be documented, and excise all screen.width/height references
X add to the 'changes' document
X saveBytes() error when writing to existing file
X http://code.google.com/p/processing/issues/detail?id=667
cleanup
o if too many errors come through during setup, app will terminate