def strip_dir_path(source, dirname):
    """Keep the folder structure after the path folder by
    a) appending a '/' at the end of directory names
    b) removing the first character from a directory name if it is a '/'
    The result should look like this:
    file1.txt
    folder1/
    folder1/folder2/
    folder1/folder2/file2.txt
    """
    prefix = ''
    prefix = dirname.replace(source, '')
    if prefix != '':
        prefix += '/'
        if prefix.startswith('/'):
            prefix = prefix[1:]
    return prefix
