Writes the file path and hash to stdout.

    Args:
      path (str): path of the file.
      hash_value (str): message digest hash calculated over the file data.
17615
def WriteFileHash(self, path, hash_value):
    
    string = '{0:s}\t{1:s}'.format(hash_value, path)

    encoded_string = self._EncodeString(string)
    print(encoded_string)
1108589
def write(self, output_file):
        
        for message_level, message_text in self:
            output_file.write('%s=%s\r\n' % (message_level, message_text))
        output_file.write('\r\n')
786326
def file_hash(path, hash_type='md5'):
    
    if os.path.exists(path):
        h = getattr(hashlib, hash_type)()
        with open(path, 'rb') as source:
            h.update(source.read())
        return h.hexdigest()
    else:
        return None
722869
def write_json_file(self, path):
        
        with open(path, 'w') as f:
            json.dump(self.to_dict(), f, indent=2)
962796
def write_file(self, path, contents):
		
		path = self._get_dist_path(path)
		if not os.path.isdir(os.path.dirname(path)):
			os.makedirs(os.path.dirname(path))
		if isinstance(contents, bytes):
			mode = 'wb+'
		else:
			mode = 'w'
		with open(path, mode) as file:
			file.write(contents)
732338
def parse_file(path)
      {}.tap do |hash|
        File.readlines(path).each do |line|
          key, value = line.split(SEPARATOR)
          hash[key] = value.strip
        end
      end
    end
140918
def sha256_file(path):
    
    h = hashlib.sha256()

    with open(path, 'rb') as f:
        for chunk in iter(lambda: f.read(CHUNK_SIZE), b''):
            h.update(chunk)

    return h.hexdigest()
1227136
def write_content_to_file(file_path, content)
      File.open(file_path, 'w') do |f|
        f.write content
      end
    end
378649
def save(self, path):
        
        # remember and restore file position
        pos = self.tell()
        self.seek(0)

        with fopen(path, 'wb') as output:
            output.truncate(self.length)
            for chunk in iter(lambda: self.read(1024), b''):
                output.write(chunk)

        self.seek(pos)
1312768
def tar_files(self, path: Path) -> bytes:
        
        tarstream = BytesIO()
        tar = tarfile.TarFile(fileobj=tarstream, mode='w')
        tar.add(str(path), arcname="data", recursive=True)
        tar.close()
        return tarstream.getvalue()
1372312
def _write_value(value, path):
    
    base_command = "echo '{0}' > {1}"
    # There is no common method for redirecting stderr to a null sink, so the
    # command string is platform-dependent
    if platform == 'win32':
        command = "{0} > NUL".format(base_command)
    else:
        command = "exec 2> /dev/null; {0}".format(base_command)
    os.system(command.format(value, path))
545387
def write(text, path):
    
    with open(path, "wb") as f:
        f.write(text.encode("utf-8"))
602789
public static void stringToFile(FileSystem fs, Path path, String string)
	    throws IOException {
		OutputStream os = fs.create(path, true);
		PrintWriter pw = new PrintWriter(os);
		pw.append(string);
		pw.close();
	}
406225
def _write_object(self, path, value):
    ''''''
    ensure_directory_exists(os.path.dirname(path))

    with open(path, 'w') as f:
      f.write(value)
985831
def dump(path, value)
      return unless disk_cache_enabled?

      FileUtils.mkdir_p(File.dirname(path))
      File.open(path, "wb") do |cached_file|
        Marshal.dump(value, cached_file)
      end
    end
921874
def save(self, path):
        

        path_dir = os.path.split(path)[0]
        if not os.path.exists(path_dir):
            try:
                os.makedirs(path_dir)
            except OSError:
                pass

        with open(path, 'wb') as out:
            out.write(self._bytes_body if self._bytes_body is not None
                      else b'')
604410
def _md5_sum_file(path):
    
    with Path(path).open('rb') as fhandle:
        md5sum = hashlib.md5()
        while True:
            data = fhandle.read(8192)
            if not data:
                break
            md5sum.update(data)
    return md5sum.hexdigest()