def METHOD_NAME(fns):
    """
    Sort the given file by the first timestamp
    return [string]: list of filenames, sorted
    """
    fn_ts = {} # str -> float: filename -> timestamp
    for fn in fns:
        # Get the first timestamp
        try:
            f = open_file(fn)
        except Exception:
            logging.exception("Failed to open file %s", fn)
            continue
        # Keep reading a line until we find a valid timestamp
        for l in f.readlines():
            try:
                fn_ts[fn] = read_timestamp(l)[0]
                break
            except ValueError:
                logging.debug("Failed to parse timestamp in: %s", l)
        f.close()
    sorted_fn = sorted(fn_ts, key=lambda k: fn_ts[k])
    return sorted_fn