def add_suffix_to_file_name(file_name, suffix=None):
    """Adds the specified suffix, if any, either to the end of the specified
    file_name; or, if the file_name has an "extension" starting with a dot ('.'),
    then just in front of the dot.
    """
    result = file_name
    if suffix:
        ext_index = str(file_name).rfind('.')
        if ext_index > -1:
            file_name = file_name[:ext_index] + suffix + file_name[ext_index:]
        else:
            file_name += suffix
    return file_name