Use the right API for iterating a directory

Authored by apol on May 13 2018, 9:09 AM.

Description

Use the right API for iterating a directory

Use DirEntries instead of constructing paths and request data randomly
makes the script a bit faster and the code easier to read.