From c330ad22d878c89f3fa90d00db78ad68f8dfc453 Mon Sep 17 00:00:00 2001 From: benfry Date: Mon, 18 Apr 2005 23:55:25 +0000 Subject: [PATCH] properly remove folders that are overwritten on "save as" --- processing/app/Sketch.java | 7 +++++++ processing/todo.txt | 9 +-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/processing/app/Sketch.java b/processing/app/Sketch.java index 0b8d9ef88..e4aec51bf 100644 --- a/processing/app/Sketch.java +++ b/processing/app/Sketch.java @@ -736,6 +736,13 @@ public class Sketch { } } catch (IOException e) { } + // if the new folder already exists, then need to remove + // its contents before copying everything over + // (user will have already been warned) + Base.removeDir(newFolder); + // in fact, you can't do this on windows because it tries + // to go into the same folder, but it happens on osx a lot. + // copy the entire contents of the sketch folder Base.copyDir(folder, newFolder); diff --git a/processing/todo.txt b/processing/todo.txt index afe52d110..8c9c04c05 100644 --- a/processing/todo.txt +++ b/processing/todo.txt @@ -9,6 +9,7 @@ X update the script for the mailing list save as... bugs X make sure that the sketch folder still exists when doing any operation X otherwise editor gets into a weird state +X remove a folder if someone tries to replace it via "save as" pending _ rename video.Camera to video.Video ? Capture ? @@ -55,14 +56,6 @@ file is empty. the only way to make File>Save As actually save new files, as far as i can tell, is to Save As once, make at least one change, then Save. -what happens if folder already exists on save as? - -saving a project over an already existing project does not get rid of -the .pde files that arent overwritten. not sure if this is feature or -bug, but it took me by surprise. it seemed to only overwrite .pde -files with the same name, but everything else in that project folder -stays as is. - . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .