Write the given string to the file provided.
178457
private void writeFile(File file, String csvData) throws IOException {

        LOG.debug("Will try to write CSV data to file: " + file.getAbsolutePath());
        FileUtils.writeStringToFile(file, csvData, Charset.forName(ENCODING), false);
        LOG.debug("Finished writing CSV data to file: " + file.getAbsolutePath());
    }
1326531
def _file_write(path, content):
    '''
    
    '''
    with salt.utils.files.fopen(path, 'w+') as fp_:
        fp_.write(salt.utils.stringutils.to_str(content))
    fp_.close()
437298
def write_file(writer, filename):
  """"""
  for line in txt_line_iterator(filename):
    writer.write(line)
    writer.write("\n")
132868
def write_str(self, s):
        """"""
        self.write(s)
        self.room -= len(s)
589704
def write(self, data):
        """"""

        if len(data) > self.data_size:
            raise ValueError

        self.__fileobj.seek(self.data_offset)
        self.__fileobj.write(data)
722395
def write_file(self, filename, **kwargs):
        
        with zopen(filename, "wt") as f:
            f.write(self.get_string(**kwargs))
108344
public static void stringToFile(String string, File file, String charsetName) {
		FileOutputStream fos = null;
		Writer writer = null;
		try {
			try {
				fos = new FileOutputStream(file);
				writer = new OutputStreamWriter(fos, charsetName);
				writer.write(string);
			} finally {
				if (writer != null) {
					writer.close();
				} else if (fos != null) {
					fos.close();
				}
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
1072214
def write_file(filename = 'foo', string = nil)
      raise ExportError, 'Nothing to export for #{filename}.' if string.nil? || string == ""
      f = File.new( File.expand_path(File.join(export_path, filename)), 'w+')
      f.puts string
      f.close
    end
408601
private static void writeString(String str, DataOutput writer) throws IOException {
		if (str == null) {
			writer.writeInt(0);
		} else {
			int blocks = str.length() >> 15;
			writer.writeInt(blocks+1);
			int end = 0;
			for (int i=0; i<blocks; i++) {
				int start = end;
				end = (i+1)<<15;
				writer.writeUTF(str.substring(start, end));
			}
			writer.writeUTF(str.substring(end));
		}
	}
1356360
def write_string(self, string):
        """"""
        self.write_uint16(len(string))
        self.write_bytes(string, len(string))
1099009
private static void writeString(String str, DataOutput writer) throws IOException {
		if (str == null) {
			writer.writeByte(0);
		} else {
			int blocks = str.length() >> 15;
			// Use smallest number of bytes possible for number of blocks.
			if (blocks > 0x3FFFFF) {
				// Need 4 bytes
				writer.writeByte(0xc0 | (blocks >> 24));
				writer.writeByte(0xFF & (blocks >> 16));
				writer.writeByte(0xFF & (blocks >> 8));
			} else if (blocks > 0x3FFF) {
				// Need 3 bytes
				writer.writeByte(0x80 | (blocks >> 16));
				writer.writeByte(0xFF & (blocks >> 8));
			} else if (blocks > 0x3F) {
				// Need 2 bytes
				writer.writeByte(0x40 | (blocks >> 8));
			}
			// Need to add 1 to number of blocks to avoid confusion with 'null'
			writer.writeByte(0xFF & (blocks+1));
			int end = 0;
			for (int i=0; i<blocks; i++) {
				int start = end;
				end = (i+1)<<15;
				writer.writeUTF(str.substring(start, end));
			}
			writer.writeUTF(str.substring(end));
		}
	}
892936
def WriteFileEntry(self, path):
    
    string = '{0:s}\n'.format(path)

    encoded_string = self._EncodeString(string)
    self._file_object.write(encoded_string)
849199
def write_file(self, file, verbose=False):
        """"""
        dat = self.get_midi_data()
        try:
            f = open(file, 'wb')
        except:
            print "Couldn't open '%s' for writing." % file
            return False
        try:
            f.write(dat)
        except:
            print 'An error occured while writing data to %s.' % file
            return False
        f.close()
        if verbose:
            print 'Written %d bytes to %s.' % (len(dat), file)
        return True
154683
def writeString(self, s):
        
        s = self.context.getBytesForString(s)

        self.writeBytes(s)
678852
def write_string(self, string):
        
        buf = bytes(string, 'UTF-8')
        length = len(buf)
        self.write_int(length)
        self.write(buf)
217216
def write(self, text, encoding="utf-8"):
        
        logger.info("Writing to %s" % self)
        with codecs.open(self.path, 'w', encoding) as fout:
            fout.write(text)
896695
public function write($string)
    {
        $fileName = $this->getFileName();
        $handle = $this->getHandle();

        if (fwrite($handle, $string) === false) {
            throw new \Exception('Cannot write to file ' . $fileName);
        }
    }