Open a file for writing.
434869
@Override
  //@Direct
  public void openWrite(Result<OutputStream> result,
                        WriteOption ...options)
  {
    result.ok(_root.openWriteFile(_path, options));
  }
1204742
public void openReadWrite(ReadStreamOld is, WriteStreamOld os) throws IOException
  {
    getWrappedPath().openReadWrite(is, os);
  }
722395
def write_file(self, filename, **kwargs):
        
        with zopen(filename, "wt") as f:
            f.write(self.get_string(**kwargs))
449070
public int openForWrite(String Filename, WaveFile OtherWave)
	{
		return openForWrite(Filename, OtherWave.getSamplingRate(), OtherWave.getBitsPerSample(), OtherWave.getNumChannels());
	}
354530
public function OpenWriter() {
        $filePath = $this->dir . $this->fileName;
        echo $filePath . "<br />";

//    if(!file_exists($filePath)) {
//      file_put_contents($filePath, "");
//    }
        $this->writer = fopen($filePath, 'w') or die("can't open file");
    }
6112
def open_file(file, mode):
	
	if hasattr(file, "read"):
		return file
	if hasattr(file, "open"):
		return file.open(mode)
	return open(file, mode)
1067828
def _create_file(self, filename):
        """"""
        file_descriptor = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL)
        return os.fdopen(file_descriptor, 'w')
379121
def open_by_pat(self, name, mode='r', **kwargs):
        '''
        
        '''
        fname = self.fname_by_pat(name, **kwargs)
        if mode == 'w':
            print >>sys.stderr, "Write[%s]: %s" % (name, fname)
        else:
            print >>sys.stderr, "Open[%s]: %s" % (name, fname)
        return file(fname, mode)
321012
def write_file(data, outfilename):
    """"""
    if not data:
        return False
    try:
        with open(outfilename, 'w') as outfile:
            for line in data:
                if line:
                    outfile.write(line)
        return True
    except (OSError, IOError) as err:
        sys.stderr.write('An error occurred while writing {0}:\n{1}'
                         .format(outfilename, str(err)))
        return False
361968
def _open_file(cls, writer_spec, filename_suffix, use_tmp_bucket=False):
    """"""
    if use_tmp_bucket:
      bucket = cls._get_tmp_gcs_bucket(writer_spec)
      account_id = cls._get_tmp_account_id(writer_spec)
    else:
      bucket = cls._get_gcs_bucket(writer_spec)
      account_id = cls._get_account_id(writer_spec)

    # GoogleCloudStorage format for filenames, Initial slash is required
    filename = "/%s/%s" % (bucket, filename_suffix)

    content_type = writer_spec.get(cls.CONTENT_TYPE_PARAM, None)

    options = {}
    if cls.ACL_PARAM in writer_spec:
      options["x-goog-acl"] = writer_spec.get(cls.ACL_PARAM)

    return cloudstorage.open(filename, mode="w", content_type=content_type,
                             options=options, _account_id=account_id)
1272243
def write_file(name, text, opts):
    """"""
    fname = path.join(opts.destdir, '%s.%s' % (name, opts.suffix))
    if opts.dryrun:
        print 'Would create file %s.' % fname
        return
    if not opts.force and path.isfile(fname):
        print 'File %s already exists, skipping.' % fname
    else:
        print 'Creating file %s.' % fname
        f = open(fname, 'w')
        try:
            f.write(text)
        finally:
            f.close()
801676
def writefile(openedfile, newcontents):
    """"""
    openedfile.seek(0)
    openedfile.truncate()
    openedfile.write(newcontents)
1160539
def open_fifo_write(path, data):
    '''
    '''
    os.mkfifo(path, stat.S_IRUSR | stat.S_IWUSR)
    threading.Thread(target=lambda p, d: open(p, 'wb').write(d),
                     args=(path, data)).start()
511986
def open(self, directory=None, filename=None, mode="rb"):
        """"""
        path = os.path.join(directory, filename)
        return open(path, mode)
695639
def file(self, name, *args, **kwargs):
        
        return open(self(name), *args, **kwargs)
944528
def write_file(path, data, mode='w'):  # type: (str, str, str) -> None
    
    with open(path, mode) as f:
        f.write(data)
1187198
def write_file(self, new_text, filename, old_text, encoding=None):
        
        try:
            f = _open_with_encoding(filename, "w", encoding=encoding)
        except os.error as err:
            self.log_error("Can't create %s: %s", filename, err)
            return
        try:
            f.write(_to_system_newlines(new_text))
        except os.error as err:
            self.log_error("Can't write %s: %s", filename, err)
        finally:
            f.close()
        self.log_debug("Wrote changes to %s", filename)
        self.wrote = True