loadImage then delete file?
in
Programming Questions
•
1 year ago
First time poster, long time programmer.
loadImage works great! I want to delete the file when I'm done. How?
This code works if these 2 files exist in my Sketch folder:
loadImage works great! I want to delete the file when I'm done. How?
This code works if these 2 files exist in my Sketch folder:
- import java.io.File;
PImage img;
void setup(){
img = loadImage("t2.jpg");
//img.save("t3.jpg");
//img.loadPixels();
//img.updatePixels();
String fn=sketchPath("t3.jpg");
File ddf=sketchFile(fn);
if(ddf.exists()){
println(ddf.delete());
}
else {
print("NotExist ");
println(fn);
}
}
void draw(){
}
But try changing t3 -> t2.jpg.
The file is still open?
How do I close it?
It can not delete it.
Why not?
How can I?
I feel that I've tried everything.
Please help!
I've noticed I can delete it from Windows Vista while a different Sketch is running trying to delete it.
The file is still open?
How do I close it?
It can not delete it.
Why not?
How can I?
I feel that I've tried everything.
Please help!
I've noticed I can delete it from Windows Vista while a different Sketch is running trying to delete it.
1