def prefixed_path_string(path, prefix=''):
    """Return the prefixed version of this string"""
    while path and path[0] == '.':
        path = path[1:]
    while path and path[-1] == '.':
        path = path[:-1]
    while prefix and prefix[0] == '.':
        prefix = prefix[1:]
    while prefix and prefix[-1] == '.':
        prefix = prefix[:-1]
    if not prefix:
        return path, path
    elif not path:
        return prefix, prefix
    else:
        res = '{0}.{1}'.format(prefix, path)
        return res, res
