How to delete a file?

Sydney Bristow's icon

Does anyone know how one can delete a file using Max? My application creates temp files and it would be nice if I could delete them.

I need this functionality for both Windows and Mac.

Thanks,

Syndey B.

Wesley Smith's icon

you can us an mxj and the JAVA File class which has a method delete().

wes

Isjtar's icon

on osx, you can use the shell object and the rm unix command.
on windows, maybe f.e.'s winhack objects can help you out, though i have no experience with winmax.

f.e's icon

Yep. WinHack contains DOSHack class that does this very quickly.

best

f.e

Sydney Bristow's icon

It turns out that Bill Orcutt, the creator of the “shell” object also made a “rm” object (remove) with versions for OS X as well as Windows.

A list of Bill’s objects can be found here: http://www.maxobjects.com/?v=authors&id_auteur=44&re quested=shell&operateur=AND&id_plateforme=0

And they can be downloaded from here:
http://www.publicbeta.cx/max/

Note: maxobjects.com is not up-to-date. Many of the object also have a Windows version.

Syndey B.

Lê Quan Ninh's icon