Empty first line cache if file did change
178012
protected function onFileChanged()
    {
        $this->firstLinesRaw = null;
        $this->firstLines = null;
        if ($this->separatorWasDetected) {
            $this->separator = '';
            $this->separatorWasDetected = false;
        }
        if ($this->headerWasDetected) {
            $this->setHeader([]);
            $this->headerWasDetected = false;
        }
    }
1330178
def if_file_changed(file, &block)
      if_string_changed(file, Digest::SHA256.file(file).hexdigest.to_s, &block)
    end
211838
function checkIfFileWasUpdated($file)
    {
        $absoluteFilePath = ROOTPATH . $file;
        if (file_exists($absoluteFilePath)) {
            $fileExtension = pathinfo($file, PATHINFO_EXTENSION);
            $fileName = pathinfo($file, PATHINFO_FILENAME);
            $fileFullName = pathinfo($file, PATHINFO_BASENAME);
            $minifiedFileName = substr($file, 0, -strlen($fileFullName)) . $fileName . '.minified.' . $fileExtension;
            $changeDate = filectime($absoluteFilePath);
            $changeDateMinified = file_exists(ROOTPATH . $minifiedFileName) ? filectime(ROOTPATH . $minifiedFileName)
                : 0;
            if ($changeDateMinified == 0 || $changeDate < $changeDateMinified) {
                return $minifiedFileName;
            }
        }

        return null;
    }
1175216
def clear_file_list_cache(self, load):
        '''
        
        '''
        if 'env' in load:
            # "env" is not supported; Use "saltenv".
            load.pop('env')

        saltenv = load.get('saltenv', [])
        if saltenv is not None:
            if not isinstance(saltenv, list):
                try:
                    saltenv = [x.strip() for x in saltenv.split(',')]
                except AttributeError:
                    saltenv = [x.strip() for x in six.text_type(saltenv).split(',')]

            for idx, val in enumerate(saltenv):
                if not isinstance(val, six.string_types):
                    saltenv[idx] = six.text_type(val)

        ret = {}
        fsb = self.backends(load.pop('fsbackend', None))
        list_cachedir = os.path.join(self.opts['cachedir'], 'file_lists')
        try:
            file_list_backends = os.listdir(list_cachedir)
        except OSError as exc:
            if exc.errno == errno.ENOENT:
                log.debug('No file list caches found')
                return {}
            else:
                log.error(
                    'Failed to get list of saltenvs for which the master has '
                    'cached file lists: %s', exc
                )

        for back in file_list_backends:
            # Account for the fact that the file_list cache directory for gitfs
            # is 'git', hgfs is 'hg', etc.
            back_virtualname = re.sub('fs$', '', back)
            try:
                cache_files = os.listdir(os.path.join(list_cachedir, back))
            except OSError as exc:
                log.error(
                    'Failed to find file list caches for saltenv \'%s\': %s',
                    back, exc
                )
                continue
            for cache_file in cache_files:
                try:
                    cache_saltenv, extension = cache_file.rsplit('.', 1)
                except ValueError:
                    # Filename has no dot in it. Not a cache file, ignore.
                    continue
                if extension != 'p':
                    # Filename does not end in ".p". Not a cache file, ignore.
                    continue
                elif back_virtualname not in fsb or \
                        (saltenv is not None and cache_saltenv not in saltenv):
                    log.debug(
                        'Skipping %s file list cache for saltenv \'%s\'',
                        back, cache_saltenv
                    )
                    continue
                try:
                    os.remove(os.path.join(list_cachedir, back, cache_file))
                except OSError as exc:
                    if exc.errno != errno.ENOENT:
                        log.error('Failed to remove %s: %s',
                                  exc.filename, exc.strerror)
                else:
                    ret.setdefault(back, []).append(cache_saltenv)
                    log.debug(
                        'Removed %s file list cache for saltenv \'%s\'',
                        cache_saltenv, back
                    )
        return ret
774050
function() {
    // Cleans all cache files
    if (fs.existsSync(this.dir)) {
      var files = fs.readdirSync(this.dir);

      files.forEach(function(file) {
        fs.unlinkSync(path.join(this.dir, file));
      }.bind(this));
    }
  }
1126758
async function _handleFileInCache(filename, cache) {
  if (cache.get(filename) !== true) return cache.get(filename);
  return _addReadCallback(filename);
}
1325329
def clear_file_format_cache():
    """"""
    for fname, cache_info in file_cache.items():
        for format, lines in cache_info.lines.items():
            if 'plain' == format: continue
            file_cache[fname].lines[format] = None
            pass
        pass
    pass
273627
function cleanupCache() {
  const cacheLocation = getUserCachePath(this.options);
  if (fse.existsSync(cacheLocation)) {
    if (this.serverless) {
      this.serverless.cli.log(`Removing static caches at: ${cacheLocation}`);
    }

    // Only remove cache folders that we added, just incase someone accidentally puts a weird
    // static cache location so we don't remove a bunch of personal stuff
    const promises = [];
    glob
      .sync([path.join(cacheLocation, '*slspyc/')], { mark: true, dot: false })
      .forEach(file => {
        promises.push(fse.removeAsync(file));
      });
    return BbPromise.all(promises);
  } else {
    if (this.serverless) {
      this.serverless.cli.log(`No static cache found`);
    }
    return BbPromise.resolve();
  }
}
585908
def clear_cache(input=None):
    """"""
    if input is not None:
        n = input
    else:
        n = _choose_from_list(["Production cache", "Sandbox cache"], "Which cache would you like to clear?")

    if n == 0:
        local("redis-cli -n {} FLUSHDB".format(REDIS_PRODUCTION_CACHE_DB))
    else:
        local("redis-cli -n {} FLUSHDB".format(REDIS_SANDBOX_CACHE_DB))
643384
public void cacheFile() {
		if (orientation == Orientation.INV)
			cache = new String[fields][elements];
		else
			cache = new String[elements][fields];
		int x = 0, y = 0;
		Scanner file = null;
		try {
			file = new Scanner(csvFile);
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		String line;
		StringTokenizer tokenizer;
		while(file.hasNextLine()){
			line = file.nextLine();
			tokenizer = new StringTokenizer(line, ",");
			while(tokenizer.hasMoreTokens()){
				cache[y][x] = tokenizer.nextToken();
				x++;
			}
			x = 0;
			y++;
			
		}
		file.close();
		cached = true;
	}
945461
private static boolean ifExistsAndFresh(Configuration conf, FileSystem fs,
                                          URI cache, long confFileStamp,
                                          CacheStatus lcacheStatus,
                                          FileStatus fileStatus)
  throws IOException {
    // check for existence of the cache
    long dfsFileStamp;
    if (fileStatus != null) {
      dfsFileStamp = fileStatus.getModificationTime();
    } else {
      dfsFileStamp = getTimestamp(conf, cache);
    }

    // ensure that the file on hdfs hasn't been modified since the job started
    if (dfsFileStamp != confFileStamp) {
      LOG.fatal("File: " + cache + " has changed on HDFS since job started");
      throw new IOException("File: " + cache +
          " has changed on HDFS since job started");
    }

    if (dfsFileStamp != lcacheStatus.mtime) {
      // needs refreshing
      return false;
    }

    return true;
  }
302780
def update(oldrev=nil, newrev=nil)
      if index_file_exists? && oldrev != "0"*40
        hg([
            "log --debug -r ?:? --style ? >> ?",
            oldrev, newrev, Style.file_index, path
          ])
      else
        hg(["log --debug -r : --style ? > ?", Style.file_index, path])
      end
    end
653901
function ( noPrune ) {
        removeNotFoundFiles();

        noPrune = typeof noPrune === 'undefined' ? true : noPrune;

        var entries = normalizedEntries;
        var keys = Object.keys( entries );

        if ( keys.length === 0 ) {
          return;
        }

        var me = this;

        keys.forEach( function ( entryName ) {
          var cacheEntry = entries[ entryName ];

          try {
            var meta = useChecksum ? me._getMetaForFileUsingCheckSum( cacheEntry ) : me._getMetaForFileUsingMtimeAndSize( cacheEntry );
            cache.setKey( entryName, meta );
          } catch (err) {
            // if the file does not exists we don't save it
            // other errors are just thrown
            if ( err.code !== 'ENOENT' ) {
              throw err;
            }
          }
        } );

        cache.save( noPrune );
      }
925576
function flush(callback) {
    fs.writeFile(_this._filename, JSON.stringify(_this._cache), callback);
  }
131433
def clear
      flush
      with_tmpfile do |path, file|
        file.write(@format.header)
        file.close
        # Clear replaces the database file like a compactification does
        with_flock(File::LOCK_EX) do
          File.rename(path, @file)
        end
      end
      open
    end
258733
def update_file_status(self):
        """"""
        nfiles = len(self.cache.keys())
        status_vect = np.zeros((6), int)
        sys.stdout.write("Updating status of %i files: " % nfiles)
        sys.stdout.flush()
        for i, key in enumerate(self.cache.keys()):
            if i % 200 == 0:
                sys.stdout.write('.')
                sys.stdout.flush()
            fhandle = self.cache[key]
            fhandle.check_status(self._base_path)
            fhandle.update_table_row(self._table, fhandle.key - 1)
            status_vect[fhandle.status] += 1

        sys.stdout.write("!\n")
        sys.stdout.flush()
        sys.stdout.write("Summary:\n")
        sys.stdout.write("  no_file:      %i\n" % status_vect[0])
        sys.stdout.write("  expected:     %i\n" % status_vect[1])
        sys.stdout.write("  exists:       %i\n" % status_vect[2])
        sys.stdout.write("  missing:      %i\n" % status_vect[3])
        sys.stdout.write("  superseded:   %i\n" % status_vect[4])
        sys.stdout.write("  temp_removed: %i\n" % status_vect[5])
758388
def clear_cache(self):
        """"""
        self.logger.debug("Clearing cache")
        if os.path.isdir(self.songcache_dir):
            for filename in os.listdir(self.songcache_dir):
                file_path = os.path.join(self.songcache_dir, filename)
                try:
                    if os.path.isfile(file_path):
                        os.unlink(file_path)
                except PermissionError:
                    pass
                except Exception as e:
                    logger.exception(e)
        self.logger.debug("Cache cleared")