Delete the file from the cache, and from the upstream
770603
def remove(self, rel_path, propagate=False):
        ''''''

        if not self.upstream:
            raise Exception("CompressionCache must have an upstream")

        # Must always propagate, since this is really just a filter.
        self.upstream.remove(self._rename(rel_path), propagate)

        # In case someone called get()
        uc_rel_path = os.path.join('uncompressed', rel_path)

        self.upstream.remove(uc_rel_path)
654762
function clear() {
        var cache = caches[this.name];
        if (cache && cache.flush && !redisOffline) {
            cache.flush();
        }
    }
804961
def clean!
      files_to_keep = cache.keys.concat(cache.values)

      if (sprockets_manifest = Dir.entries("#{base_dir}").detect { |entry| entry =~ SPROCKETS_MANIFEST_REGEX })
        files_to_keep.concat(JSON.parse(File.read("#{base_dir}/#{sprockets_manifest}")).fetch("files", {}).keys)
      end

      Dir["#{base_dir}/**/*"].each do |path|
        next if File.directory?(path) || files_to_keep.include?(Pathname(path).relative_path_from(base_dir).to_s)

        FileUtils.rm(path)
      end
    end
861321
public void dispose() {
        if (_cacheFile != null && _dirty) {
            PrintStream out = null;
            try {
                File parent = _cacheFile.getParentFile();
                if (parent.isDirectory() || parent.mkdirs()) {
                    out = new PrintStream(_cacheFile);
                    for (List<Resource> bundleInfoList : _cacheBySymbolicName.values()) {
                        for (Resource bundleInfo : bundleInfoList) {
                            out.println(bundleInfo);
                        }
                    }
                }
            } catch (IOException e) {
            } finally {
                Utils.tryToClose(out);
            }
        }
        _bundleLocations.clear();
        _cacheBySymbolicName.clear();
    }
1154189
def clear_trace_filter_cache():
    '''
    
    '''
    global should_trace_hook
    try:
        # Need to temporarily disable a hook because otherwise
        # _filename_to_ignored_lines.clear() will never complete.
        old_hook = should_trace_hook
        should_trace_hook = None

        # Clear the linecache
        linecache.clearcache()
        _filename_to_ignored_lines.clear()

    finally:
        should_trace_hook = old_hook
74223
def delete(self):
        
        if os.path.isfile(self.path):
            os.remove(self.path)
        else:
            shutil.rmtree(self.path)
1175414
def clean_cache_upstream(self):
        
        logger.info('Cleaning cache for the entire upstream pipeline')
        for step in self.all_upstream_steps.values():
            logger.info('Step {}, cleaning cache'.format(step.name))
            step.output = None
        return self
1263755
def remove(self, rel_path, propagate=False):
        ''''''
        repo_path = os.path.join(self.cache_dir, rel_path)

        if os.path.exists(repo_path):
            os.remove(repo_path)

        if self.upstream and propagate:
            self.upstream.remove(rel_path, propagate)
932154
def delete(self, digest):
        
        return self.conn.client.blob_del(self.container_name, digest)
1236743
def _cleanup(self):
        """"""
        for filename in os.listdir(self._storage_dir):
            file_path = path.join(self._storage_dir, filename)
            file_stat = os.stat(file_path)
            evaluate = max(file_stat.st_ctime, file_stat.st_mtime)
            if evaluate + self._duration < time.time():
                LOGGER.debug('Removing stale file: %s', file_path)
                os.unlink(file_path)
1684
def delete(self):
        """"""
        if self.isfile:
            os.remove(self.fn)
        elif self.isdir:
            shutil.rmtree(self.fn)
733565
public function PurgeCache() {
    foreach (glob($this->CacheDir .'/CURL_*') as $filename) {
      $seconds = $this->MaxAge($filename);
      if (file_exists($filename) && @filemtime($filename) < (time() - $seconds)) {
        @unlink($filename);
      }
    }
  }
1293916
public static function cleanup(): void
    {
        $releaseName = sprintf("%s/%s", Utilities::getBasePath(), Utilities::getReleaseName());
        if (is_file($releaseName . '.tar.gz')) {
            unlink($releaseName . '.tar.gz');
        }

        if (is_file($releaseName . '.tar')) {
            unlink($releaseName . '.tar');
        }
    }
131622
def _clear(self, pipe=None):
        
        redis = self.redis if pipe is None else pipe
        redis.delete(self.key)
1020110
def clear_cache(ip=None):
    """"""
    if ip:
        with ignored(Exception):
            client = CLIENT_CACHE[ip]
            del CLIENT_CACHE[ip]
            client.close()
    else:
        for client in CLIENT_CACHE.values():
            with ignored(Exception):
                client.close()
        CLIENT_CACHE.clear()
1347117
void purge() {

        uncommittedCache.clear();

        try {
            if (cacheReadonly) {
                close(false);
            } else {
                if (dataFile != null) {
                    dataFile.close();

                    dataFile = null;
                }

                FileUtil.getDefaultInstance().delete(fileName);
            }
        } catch (Exception e) {
            throw Error.error(ErrorCode.FILE_IO_ERROR,
                              ErrorCode.M_TextCache_purging_file_error,
                              new Object[] {
                fileName, e
            });
        }
    }
1134580
def delete(self, raise_exc=True, headers=None, files=None):
        ''''''

        return self._request(DELETE, None, raise_exc, headers, files)