Deleting files from your hard drive?
Is it possible to delete files from your hard drive with Max?
I am saving a couple of audio files and a text file in my patch and I would like to delete those files when the patch gets closed. I'm on OSX.
I know a little bit Java so maybe I could find a solution there (creating a mxj object for te problem)?
Any help would be nice.
You could do it with the 'shell' external:
http://maxobjects.com/?request=shell&operateur=AND&id_plateforme=0&id_format=0&Submit=OK
Thanks but if it is possible I would like to solve it without externals. Unless it would be something I program myself in Java.
Also I'm using Max 5.
Thanks alot!
Can I conclude from this that with the native Max objects there is no solution for the problem?
I'm afraid there isn't. But that's why Java is included in Max.
The shell option is also valid, but it's not portable on MSWin.
p
And with the "shell option" you mean the external posted above?
I mean EMV's solution. shell doesn't exist on MSWin, although there is some kind of equivalent object (DOSHack). But if you need portability, then you 'll have to check in what environment you are, and then instantiate the right object thru scripting, etc. It's a real PITA.
p
Thanks for the explanation.
Do you maybe know a way to get the files you delete into OSX's Trash instead of hard deleting them from the Hard Drive?
On OSX, you should move the file to ~/.Trash
Here again, we are loosing portability...
It can be done with my Java class but will need some tweaking:
Thanks for your quick reply. I don't care much about windows so no problems there.
Out of curiosity, can this be done with javascript too?
I don't think so!