<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def store_atlas_zonefile_data(zonefile_data, zonefile_dir, fsync=True):
 """ Store a validated zonefile. zonefile_data should be a dict. The caller should first authenticate the zonefile. Return True on success Return False on error """

    if not os.path.exists(zonefile_dir):
        os.makedirs(zonefile_dir, 0700 )

    zonefile_hash = get_zonefile_data_hash( zonefile_data )
    
    # only store to the latest supported directory
    zonefile_path = atlas_zonefile_path( zonefile_dir, zonefile_hash )
    zonefile_dir_path = os.path.dirname(zonefile_path)

    if os.path.exists(zonefile_path):
        # already exists 
        return True

    if not os.path.exists(zonefile_dir_path):
        os.makedirs(zonefile_dir_path)

    try:
        with open( zonefile_path, "wb" ) as f:
            f.write(zonefile_data)
            f.flush()
            if fsync:
                os.fsync(f.fileno())

    except Exception, e:
        log.exception(e)
        return False
        
    return True