Opens handle to write to target file.
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");
    }
531105
def getFileHandle(self, dataFile, openMethod):
        
        if dataFile in self._memoTable:
            handle = self._memoTable[dataFile]
            self._update(dataFile, handle)
            return handle
        else:
            try:
                handle = openMethod(dataFile)
            except ValueError:
                raise exceptions.FileOpenFailedException(dataFile)

            self._memoTable[dataFile] = handle
            self._add(dataFile, handle)
            if len(self._memoTable) > self._maxCacheSize:
                dataFile = self._removeLru()
                del self._memoTable[dataFile]
            return handle
1193502
def write(self, iterable):
        """"""

        io_error_text = _("Error writing to file {filepath}.")
        io_error_text = io_error_text.format(filepath=self.path)

        try:

            with open(self.path, "wb") as csvfile:
                csv_writer = csv.writer(csvfile, self.dialect)

                for line in iterable:
                    csv_writer.writerow(
                        list(encode_gen(line, encoding=self.encoding)))

        except IOError:
            txt = \
                _("Error opening file {filepath}.").format(filepath=self.path)
            try:
                post_command_event(self.main_window, self.StatusBarMsg,
                                   text=txt)
            except TypeError:
                # The main window does not exist any more
                pass

            return False
30388
def open(self, filehandle):
        """"""
        with self.lock:
            if filehandle in self.files:
                self.files[filehandle] += 1
            elif filehandle.closed:
                filehandle.open()
                self.files[filehandle] = 1
                self.past.append(filehandle)
182535
def _write(self, session, openFile, replaceParamFile=None):
        
        openFile.write(
            text(
                yaml.dump([evt.as_yml() for evt in
                           self.events.order_by(ProjectFileEvent.name,
                           ProjectFileEvent.subfolder)]
                          )
            )
        )
1315782
def _gzip_open_handle(handle):
    """""""
    import gzip
    if sys.version_info[0] > 2:
        import io
        handle = io.TextIOWrapper(gzip.GzipFile(fileobj=handle), encoding="UTF-8")
    else:
        handle = gzip.GzipFile(fileobj=handle)
    return handle
692392
def write_to_file(chats, chatfile):
    """"""
    with open(chatfile, 'w') as handler:
        handler.write('\n'.join((str(id_) for id_ in chats)))
260758
def export_handle(self, directory):
        """"""
        filename = getattr(self, 'filename')
        dest_file = "%s/%s" % (directory, filename)
        dest_dir = os.path.dirname(dest_file)
        if not os.path.isdir(dest_dir):
            os.mkdir(dest_dir, 0o700)

        return open(dest_file, 'w')
44350
def write_file(self, target_path, html):
        
        logger.debug("Building to {}{}".format(self.fs_name, target_path))
        with self.fs.open(smart_text(target_path), 'wb') as outfile:
            outfile.write(six.binary_type(html))
            outfile.close()
98208
def write_data(data, out_file):
    """"""
    with open(out_file, 'w') as handle_out:
        handle_out.write(json.dumps([data], skipkeys=True, indent=2))
78755
def write(self, filepath, skip_unknown=False):
        """"""
        fp = codecs.open(filepath, 'w', encoding='utf-8')
        try:
            self.write_file(fp, skip_unknown)
        finally:
            fp.close()
1361259
def write(self, file_handle):
        
        for k, v in self.inputs.write_values().items():
            self.set('config', k, v)
        self.set('config', 'namespace', self.namespace)
        self.manifest.write(file_handle)
1334524
protected function openFile()
    {
        ini_set('auto_detect_line_endings', 1);
        $this->fileHandle = fopen($this->filename, 'r');

        if ($this->providedHeaderRow) {
            $this->headerRow = $this->remapHeader($this->providedHeaderRow);
        }
    }
747437
protected function openWriter()
    {
        if ($this->shouldAddBOM) {
            // Adds UTF-8 BOM for Unicode compatibility
            $this->globalFunctionsHelper->fputs($this->filePointer, EncodingHelper::BOM_UTF8);
        }
    }
866167
def write(self, arg, **kwargs):
        """"""
        if hasattr(arg, 'seek'):
            self._tofile(arg, **kwargs)
        else:
            with open(arg, 'wb') as fid:
                self._tofile(fid, **kwargs)
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()
471356
def write(self, filehandle, file_format):
        
        try:
            filehandle.write(self.writestr(file_format=file_format))
        except IOError:
            raise IOError('"filehandle" parameter must be writable.')