Forums > MaxMSP

Analyzing files in a system folder, then deleting them?

Apr 09 2011 | 6:30 pm

I’d like to incorporate a function into a patch that analyzes a folder on my system, if it’s over a certain size selectively delete the older files from this folder. I cannot find the best way to do this. I’ve got the filesys external but this only takes care of deleting files. Is there a way to do this without using the filedate object to look at every individual file in a folder?

o s
Apr 09 2011 | 7:24 pm

if you are on a mac you can use [shell] or [] for that…

hth ole

Aug 10 2011 | 7:07 pm

this is an addon to [mxj filesys]

public void size (String s) {

		File f = new File(MaxSystem.maxPathToNativePath(s));
 		outlet (0, (f.length()/1024));

it will spit the size of file when the input is [c:videofoo.avi]>[prepend size]>[mxj filesys]

Viewing 3 posts - 1 through 3 (of 3 total)

Forums > MaxMSP