DavidBrainard / RenderToolbox3

Matlab toolbox for managing graphics rendering for psychophysics
MIT License
11 stars 4 forks source link

Output file size checking #50

Closed DavidBrainard closed 9 years ago

DavidBrainard commented 10 years ago

RTB3 does not contain any mechanisms for predicting and then warning about setting loose renderings that might fill up the entire disk with large files. If we could figure out a reasonable way to implement such error checking, it might save some headaches. A workaround is to point RTB3 output at a disk that does not contain the system, so that filling it will not crash the computer.

npcottaris commented 10 years ago

An alternative mechanism is to monitor free hard disk space before each rendering and to alert the user / suspend execution if the free space falls below a threshold value, say 1GByte. This would be useful for users with a single hard disk.

On Jan 5, 2014, at 9:58 AM, David Brainard notifications@github.com wrote:

RTB3 does not contain any mechanisms for predicting and then warning about setting loose renderings that might fill up the entire disk with large files. If we could figure out a reasonable way to implement such error checking, it might save some headaches. A workaround is to point RTB3 output at a disk that does not contain the system, so that filling it will not crash the computer.

— Reply to this email directly or view it on GitHub.

benjamin-heasly commented 10 years ago

I did a little bit of checking on how we might monitor free disk space. I don't see a built-in Matlab way to do this, but maybe I missed it?

On Unix-like systems, I think we can use the df command (http://unixhelp.ed.ac.uk/CGI/man-cgi?df). Something like this should work, and then we'd have scan the output: system('df -f')

On Windows, we might be able to use the wmic command, which I've never tried (http://serverfault.com/questions/68300/check-free-disk-space-using-batch-commands). Something like this, maybe: system('wmic logicaldisk where "DeviceID=''C:''" get FreeSpace')