def gather_file_data(name):
    """
    Gather data about a given file.

    Returns a dict with fields name, mtime and size, containing the relevant
    data for the fiel.
    """
    res = {'name': name}
    try:
        res['mtime'] = osp.getmtime(name)
        res['size'] = osp.getsize(name)
    except OSError:
        pass
    return res
Gather data about a given file.

    Returns a dict with fields name, mtime and size, containing the relevant
    data for the fiel.