Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support something like ulimit -f for limiting max file size for a Filer instance #265

@humphd

Description

@humphd

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions