Querying size of folder contents before polybuffer~ load

Mark Durham's icon

I'm working on a patch that loads a folder full of files into polybuffer~.

It all works well, but if you happen to select a folder either larger than available RAM or the 32bit RAM limit then this causes Max to crash.

I want to be able to test the folder contents size (just audio ideally) before commiting to the polybuffer~ load.

Any ideas?

pdelges's icon

Mac OSX?

du in a shell (du -ms /my/path) maybe.

Max Patch
Copy patch and select New From Clipboard in Max.

Mark Durham's icon

It's going to be part of a M4L device, so really needs to be Windows too - sorry, should have specified.

Mark Durham's icon

Interesting though....