Out of curiousity, are the filenames you get when you use
glob to get the filenames the same as the ones you get from using a
`dir` call? I would replace the
`dir` with a call to
glob. If glob works, you're not getting the dir properly. If it doesn't, you may get some clues about what is going wrong.
Want to support the EFF and FSF by buying cool stuff? Click
here.