r7795: add directory-tree and probe-directory functions