Page 1 of 1

Limit dir space

Posted: Sat Jan 01, 2005 8:35 am
by Clarkent
It's possible by PHP code to limit size of a directory on server ? E.g. My dir /home/umbumbym/public_html/mark (only /mark of course) must contain max 5 Mbyte ...
Can I insert a little script that verify the dir content (files and subdir) and calculate the byte amount and allows or not other uploads ...
It is possible ?


Thanks

Sorry for my english

Posted: Sat Jan 01, 2005 8:51 am
by feyd
yes, you can use the [php_man]opendir()[/php_man] or [php_man]glob()[/php_man] (newer php required) to obtain a file list and iterate through them getting sizes of each.