in reply to Re^2: Most recently created file in a folder
in thread Most recently created file in a folder

Are you getting an error from the 'glob' call? To be honest, I'm not sure how to do that -- the documentation doesn't seem to mention it.

My personal preference for reading a directory without recursion is to use opendir/readdir. That way, you can check for errors easier (e.g. does the full path exist, do you have permissions to access it, etc). You also don't have the overhead of using glob, nor relying on how the system decides to expand '*', which should be everything anyway (well, except for dot files under Unix).

bluto

  • Comment on Re^3: Most recently created file in a folder