def _find(root, thread_count=10, relative=False, follow=False):
 threads = []
 results = {}
 errors = {}
 done = threading.Event()
 work = queue.Queue()
 work.put((os.path.abspath(root), []))
 if (not relative):
  root = None
 args = (root, follow, done, work, results, errors)
 for i in range(thread_count):
  t = threading.Thread(target=_find_worker, args=args)
  t.daemon = True
  t.start()
  threads.append(t)
 work.join()
 done.set()
 for t in threads:
  t.join()
 return (results, errors)

def _find ( root , thread_count = 10 , relative = False , follow = False ) : threads = [ ] results = { } errors = { } done = threading . Event ( ) work = queue . Queue ( ) work . put ( ( os . path . abspath ( root ) , [ ] ) ) if ( not relative ) : root = None args = ( root , follow , done , work , results , errors ) for i in range ( thread_count ) : t = threading . Thread ( target = _find_worker , args = args ) t . daemon = True t . start ( ) threads . append ( t ) work . join ( ) done . set ( ) for t in threads : t . join ( ) return ( results , errors )
threaded find implementation that provides stat results for files .