
February 10th, 2013, 05:38 AM
|
|
|
|
Unless I missed something, what you have commented out at the top of your program should happily iterate over each file in the directory, which I assume is what you want to do. Please tell us where you think you have a problem.
The only thing you might want to add is to discard entries starting with a dot or, better, to test with the -f file test operator that the entry you will use next is a plain file (not a directory or something else).
Also take a look at the glob function, which can make your iteration simpler, because it returns a list of files with their path (which readdir gives you only the filenames).
Last edited by Laurent_R : February 10th, 2013 at 05:43 AM.
|