He may mention that but he actually says : " files from source directory to a destination directory on a different host. But how can i get the list of files in the source directory" - he wants a list of the files in the source i.e. local directory, I'm sure you won't dispute that readdir works there.