Analyzing files in a system folder, then deleting them?

evanlivingston's icon

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's icon

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

hth ole

yair reshef's icon

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]

2526.filesys.zip
zip