Help needed with walk_dir()

new topic     » topic index » view thread      » older message » newer message

It might help if I explain what I want to do first. I would like to select a file from a folder, and then use walk_dir() to select and process all files in the same directory, but in a particular order based on the timestamp of the file. So I will select the oldest and then need the program to select progressively "newer" files which will be processed in turn.

The default in walk_dir() is to visit files in alphabetical order, and the manual says if you want to use a different order you should:

"set the global integer my_dir to the routine id of your own modified dir() function that sorts the directory entries differently. See the default dir() function in file.e."

I've looked at the example in "search.ex" but I'm not sure how to write the dir() function which will achieve what I want. Do I need to use custom_sort()? Any help appreciated, thanks in advance!

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu