Получите chmod of Directory php

echo substr(sprintf('%o', fileperms('/path/to/directory')), -4);
// prints something like 1777
Indian Gooner