"Ryan Bloom" <[EMAIL PROTECTED]> writes: > The docs may say that, but the code doesn't do anything about "." and > "..". I just double-checked unix/dir.c. :-( I actually remember > looking at this years ago when I wrote the original code, and thinking > through the "." and ".." problem, which is why I said that APR will > return those two values first, but I don't think I ever actually coded > it, and I'm not sure how it would be done.
Heh! Pardon me while I feel smug :-)... I also felt a bit suspicious about that promise, and therefore wrote this code in Subversion a while back: for (err = svn_io_dir_read (&finfo, flags, dir, pool); err == SVN_NO_ERROR; svn_pool_clear (subpool), err = svn_io_dir_read (&finfo, flags, dir, pool)) { const char *this_path, *this_edit_path; if (finfo.filetype == APR_DIR) { /* Skip entries for this dir and its parent. (APR promises that they'll come first, so technically this guard could be moved outside the loop. But somehow that feels iffy. */ if (finfo.name[0] == '.' && (finfo.name[1] == '\0' || (finfo.name[1] == '.' && finfo.name[2] == '\0'))) continue; [...] } [...] } Anyway, will do something similar in apr_dir_check_empty(). -K