Hello All,
According to the documentation, DzApp.getTempFilename() should clear up any files in the temp_dirs it creates when Daz shuts down. Unfortunately, this doesn't seem to be the case. I've worked around this by keeping track of the temp dirs that are created in my script and then before my script ends, I clear them up with the following code:
for(var i = 0; i < app_temp_dirs.length; i++) {
// remove files in dirs
var dir_to_nuke = DzDir(app_temp_dirs[i]);
var files = dir_to_nuke.getFilesFromDir(["*.*"], true);
for(var f = 0; f < files.length; f++) {
dir_to_nuke.remove(files[f])
}
// remove dirs
dir_to_nuke.rmpath(app_temp_dirs[i]);
}
The files get removed perfectly. However, any call to DzDir.rmpath(path_to_remove) that I try fails. Which means I'm left with a ton of empty dir structures.
I have tried relative paths, absolute paths, I've used DzDir.cdUp() to maybe get out of the way. etc. etc. etc. But I can't get it to work.
Would some kind soul put me out of my misery and tell me how it's done?