Writing out temp files - How to cleanly delete when done?
-
Currently, on Vista 64 when I create the folder in sketchup ruby, if I try to delete the folder through the windows explorer it tells me the folder is currently being used in another app. And I get an error as well when I try to delete the open folder through another instance of SketchUp. I just don't know how it will react in other windows versions and on a Mac, especially since SU on OS is MDI. It might not be able to differentiate which instance of SU created the folder and which is trying to delete it. But it would be interesting to test.
-
Definitely... inquiring minds wish to know... all platform specific quirks are good knowledge. (I actually just logged on to ask a question about the Mac.)
So... can a separate Sketchup instance, even be opened on the Mac? Usually MDI apps try to keep the user working with the instance that is already open.. but sometimes a user can force a new instance to be opened.
(I recently found that this is true of Notepad++, by accident. If the app window is smaller than the screen, and you grab one particular filetab, and drag it out of the app and drop it on the desktop, it opens a new Notepad++ instance, with only that file open. And if you drag a file from an instance that only has that file open, into another instance, and the second instance closes automatically. So i'd be interested to know if Mac Sketchup has this behavior.)
-
@chris fullmer said:
Currently, on Vista 64 when I create the folder in sketchup ruby, if I try to delete the folder through the windows explorer it tells me the folder is currently being used in another app. And I get an error as well when I try to delete the open folder through another instance of SketchUp. I just don't know how it will react in other windows versions and on a Mac, especially since SU on OS is MDI. It might not be able to differentiate which instance of SU created the folder and which is trying to delete it. But it would be interesting to test.
Chris,
Not being able to delete a folder/file on Windows typically means there is a process somewhere with a 'handle' to the file/folder. Yes, it is pathetic that Windows still cannot handle stuff like this - every other OS can.. but anyway..
First double check you really are releasing the File Descriptor handle you use in Ruby. If you the file isn't really closed, you won't be able to delete it.
Adam
Advertisement