
12 Mar
2010
12 Mar
'10
1:36 p.m.
Zitat von "Vial, Florent"
Hi boost-users,
I am using a recursvive function for iterating over a starting path. When i finally arrive in a directory that contains no subdirectory (what i call a "final" directory), i want to retrieve the first and the last file of this directory.
define "first" and "last". directory iterators are single-pass input iterators, meaning that they represent no particular order. if you iterate over the same directory 2 times, you might retrieve the entries in a different order. you could e.g. copy the entries to a std::vector using std::copy and then sort them, choose first and last, etc.