Guido van Rossum wrote: > On 6/28/06, Brett Cannon <[EMAIL PROTECTED]> wrote: >> On 6/28/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: >>> - File size should be rounded up to some block size (512 if you don't >>> have filesystem specific information) before adding to the total. >> Why? > > Because that's how filesystems work. Allocations are in terms of block > sizes. 1000 files of 1 byte take up the same space as 1000 files of > 512 bytes (in most common filesystems anyway -- I think Reiserfs may > be different).
Forgive me if I'm missing the obvious but shouldn't block size be taken into consideration when setting the cap rather than for testing the file size? E.g., what happens if you specify a cap of 100 bytes, your block size is 512 and the user tries to write a single byte? Fail, because it's logically allocation 512 and the cap is at 100? That seems backwards to me since it would require that the app first determine the block size of the OS it's running on before it can even set a "working" cap. And if the interpreter implicitly rounds the cap up to block size, then there isn't much of a point in specifying the number of bytes to begin with - perhaps use number of blocks instead? In any case, I'd argue that if you allow the cap to be set at any specific number of bytes, the interpreter should honor *exactly* that number of bytes, blocks or not. Cheers, - Andreas _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com