Revert "delete listdir func"

This reverts commit 7e646eb0fb899e1979edf077e7fd32fc4a5d5ca0.