def find_base(path):
	"""Find the base of a glob."""
	result = _pattern.match(path)

	if result:
		base = result.group(0)
	else:
		base = "./"

	if base.endswith('/') or base.endswith('\\'):
		return os.path.abspath(base)
	else:
		return os.path.dirname(os.path.abspath(base))
Find the base of a glob.