Block-Game-Client/runtime/pylibs/whereis.py

22 lines
431 B
Python
Raw Normal View History

2019-11-17 17:55:58 +01:00
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 8 16:36:26 2011
@author: ProfMobius
@version: v0.1
"""
import os
import logging
def whereis(filename, rootdir):
if not os.path.exists(rootdir):
return []
logging.info('> Searching for %s in %s', filename, rootdir)
results = []
for path, _, filelist in os.walk(rootdir):
if filename in filelist:
results.append(path)
return results