I'm not sure whether this should be done in Filer, MakeDrive, or some app, but today we were discussing the need to limit file sizes. For example, in MakeDrive we don't want people uploading 300M video files. It might be nice to be able to do something like this:
var fs = new Filer.FileSystem({limits: {maxFileSize: 3072}});
...
var buf = new Buffer(3072 + 1);
fs.writeFile('/bigfile', buf, function(err) {
expect(err.code).to.equal('EPERM');
expect(err.message).to.equal('maximum file size reached');
});
Thoughts? You could also limit the number of file descriptors you can open, maybe other things.