<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_cache(config_fpath, cache_dir):
 """Write the cache directory to the dtool config file. :param config_fpath: path to the dtool config file :param cache_dir: the path to the dtool cache direcotory """

    cache_dir = os.path.abspath(cache_dir)
    return write_config_value_to_file(
        CACHE_DIRECTORY_KEY,
        cache_dir,
        config_fpath
    )