dir-iterator: add flags parameter to dir_iterator_begin