Uncaches given file.

        :param file: File to uncache.
        :type file: unicode
14631
def __uncache(self, file):
        

        if file in self.__files_cache:
            self.__files_cache.remove_content(file)
515494
def read_file(file):
	
	if hasattr(file, "read"):
		return file.read()
	if hasattr(file, "read_bytes"):
		return file.read_bytes()
	with open(file, "rb") as f:
		return f.read()
1262090
function(file) {
    if (!AST.cache) {
      return;
    }
    else if (typeof file === 'string') {
      if (!AST.cache[file]) AST.cache[file] = null;
    }
    else if (file.isParsed() && !file.timestamp) {
      file.timestamp = Date.now();
      AST.cache[file.file] = file;
    }
  }
173130
def uncache(self, name):
        
        delme = []
        if self._is_pattern(name):
            expr = re.compile(self._pattern_to_regex(name))
            for key, obj in self._cached.items():
                if expr.match(key):
                    delme.append(key)
        else:
            if name in self._cached:
                delme.append(name)
        for key in delme:
            del self._cached[key]
478660
private static void unpackFile(InputStream in, File file) {
        byte[] buffer = new byte[4096];

        try {
            OutputStream out = new FileOutputStream(file);
            int read;
            while ((read = in.read(buffer)) != -1) {
                out.write(buffer, 0, read);
            }
            out.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
1258079
function processFile(file, encoding) {
    var fileContent = file.contents.toString(encoding),
        matches = fileContent.match(reg$$Global),
        expression,
        tempRegResults,
        name,
        value,
        replaceStr;

    if(null === matches) {
        return file;
    }
    for(var i = 0, len = matches.length; i < len; i ++) {
        expression = matches[i];
        tempRegResults = expression.match(reg$$);
        name = tempRegResults[1];
        value = tempRegResults[2];

        replaceStr = (resolvers[name] || loop)(file, valueProcess(name, value));
        //替换表达式的值为应该替换的那一部分
        fileContent = fileContent.replace(expression, replaceStr.replace("$", "$$$$"));
    }

    file.contents = new Buffer(fileContent);
    return file;
}
387741
def open_file(self, file_):
        
        with open(file_, 'r', encoding='utf-8') as file:
            text = ''
            for line in file:
                text += line
        return text
325476
def _write_cache(self, lines, append=False):
        """"""
        mode = 'at' if append else 'wt'
        with open(self.filepath, mode, encoding='utf8') as fh:
            fh.writelines(line + '\n' for line in lines)
588927
public static String slurpFile(File file, String encoding) throws IOException {
    return IOUtils.slurpReader(IOUtils.encodedInputStreamReader(
            new FileInputStream(file), encoding));
  }
1159189
def from_file(filename, encoding='utf-8')
      mode = "rb:#{encoding}"
      mode = "rb" if RUBY_VERSION < '1.9'
      input = File.open(filename, mode) {|f| f.read() }
      compile(parse(input), filename, 1)
      return self
    end
623416
public static Writer newBufferedUTF8FileWriter(final String file) throws UnsupportedEncodingException, FileNotFoundException {
        return new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"));
    }
3212
private static function cache(File $cache, File $file) {

		if(false === isset(static :: $translations[$cache -> entity() -> getName()])) {

			$parse = true;

			if(true === $cache -> exists()) {
				
				if($cache -> entity() -> getModificationTime() >= $file -> entity() -> getModificationTime()) {
					$parse = false;
				}
			}

			//Check if file needs to be parsed
			if(true === $parse) {

				$content = serialize(static :: parse($file));
				$cache -> create() -> flush() -> append($content);
			}

			static :: $translations[$cache -> entity() -> getName()] = unserialize($cache -> getContent());
		}
	}
1141644
public static void load(File file)
    {
        try(FileInputStream inputStream = new FileInputStream(file))
        {
            LineIterator it = IOUtils.lineIterator(inputStream, "UTF-8");
            while (it.hasNext())
            {
                String line = it.next();
                if (!line.startsWith("#") && !line.trim().isEmpty())
                {
                    add(line);
                }
            }
        }
        catch (Exception e)
        {
            throw new WindupException("Failed loading archive ignore patterns from [" + file.toString() + "]", e);
        }
    }
1033464
private void unpackFile(File file) throws MojoExecutionException {

    // initialize unpacker to validate patterns
    ContentUnpackerProperties props = new ContentUnpackerProperties();
    props.setExcludeFiles(this.excludeFiles);
    props.setExcludeNodes(this.excludeNodes);
    props.setExcludeProperties(this.excludeProperties);
    props.setExcludeMixins(this.excludeMixins);
    ContentUnpacker unpacker = new ContentUnpacker(props);

    // validate output directory
    if (this.unpackDirectory == null) {
      throw new MojoExecutionException("No unpack directory specified.");
    }
    if (!this.unpackDirectory.exists()) {
      this.unpackDirectory.mkdirs();
    }

    // remove existing content
    if (this.unpackDeleteDirectories != null) {
      for (String directory : unpackDeleteDirectories) {
        File directoryFile = FileUtils.getFile(this.unpackDirectory, directory);
        if (directoryFile.exists()) {
          if (!deleteDirectoryWithRetries(directoryFile, 0)) {
            throw new MojoExecutionException("Unable to delete existing content from "
                + directoryFile.getAbsolutePath());
          }
        }
      }
    }

    // unpack file
    unpacker.unpack(file, this.unpackDirectory);

    getLog().info("Package unpacked to " + this.unpackDirectory.getAbsolutePath());
  }
932557
def clear(self, encoding=Constants.default_codec):
        

        if foundations.strings.is_website(self.__path):
            raise foundations.exceptions.UrlWriteError(
                "!> {0} | '{1}' url is not writable!".format(self.__class__.__name__, self.__path))

        if self.uncache():
            LOGGER.debug("> Clearing '{0}' file content.".format(self.__path))
            return self.write(encoding=encoding)
        else:
            return False
1370088
public synchronized void remove(final File file) {
        final T t = cache.get(file);
        expiry.remove(file);
        cache.remove(file);
        if (null != t && t instanceof Expireable) {
            final Expireable exp = (Expireable) t;
            exp.expire();
        }
    }
769812
def from_file(self, filename):
        
        with gzip.open(filename, 'rb') as f:
            self.parse(f.read())