Mi sa che devi fare ricorso a system() per fare un ls.

http://it2.php.net/system
http://it2.php.net/chmod