Write File

@param type $file
@param type $content
507813
public function write($file, $content = "", $mode = "w+")
    {

        $stream = $this->getFileStream($file, $mode);

        //Write the contents
        fwrite($stream, $content);
        fclose($stream);

        return true;
    }
1130038
public static function write(string $file, $content, int $mode = 0666): void
	{
		NetteFileSystem::write($file, $content, $mode);
	}
360547
protected function writeFileContent($file, $data)
    {
        $handler = file_put_contents($file, $data);
        
        return $handler === false ? false : true;
    }
754384
public function write($file = "")
    {
        $envString = $this->generateEnvString($this->lines);
        file_put_contents($file ? $file : $this->filePath, $envString);
    }
1009725
public function writeContent(array $content)
    {
        if (!$this->canWrite()) {
            throw new Exception("Unable to write file {this->file}.");
        }
        
        $json = $this->jsonEncode($content);
        
        return $this->writeFileContent($this->file, $json);
    }
1282581
function(file, content, callback) {
			fs.writeFile(file, content, 'ascii', function(err) {
				callback(err ? err : null);
			});
		}
64170
public void write(String filename, String content) throws IOException {
    FSDataOutputStream s = getMfs().create(new Path(filename));
    s.writeBytes(content);
    s.close();
  }
207716
public function putContent($content)
    {
        // write to io stream
        $this->size = fwrite($this->inputStream, $content);
        // rewind file pointer
        rewind($this->inputStream);
    }
370348
public function writeContent($content, $overwrite = false)
    {

        if ($overwrite) {
            $fh = fopen($this->getPath(), 'w');
        } else {
            $fh = fopen($this->getPath(), 'w+');
        }
        fwrite($fh, $content);
        fclose($fh);
    }
529434
protected function _write($path, $content)
    {
        $File = new File($path);
        $File->write($content);
        $File->exists();
    }
440398
public static function put(string $file, string $content): int
    {
        if (!self::exists(dirname($file))) {
            self::mkDir(dirname($file));
        }
        return file_put_contents($file, $content);
    }
396629
function writeFile(file, content) {
    fs.writeFileSync(file, content);
    files.push(path.relative(app.components.get('path'), file));
}
73433
private function writeToFile($file, $content, $origin = 'n/a')
    {
        return file_put_contents($file, $this->getFileSignature($origin) . $content);
    }
180184
protected function writeToFile($file, $content)
    {
        if (!function_exists('gzopen')) {
            throw new \Exception('metaseo needs zlib support');
        }

        $fp = gzopen($file, 'w');

        if ($fp) {
            gzwrite($fp, $content);
            gzclose($fp);
        } else {
            throw new \Exception('Could not open ' . $file . ' for writing');
        }
    }
754852
public function write($file = "")
    {
        $iniString = $this->generateIniString($this->config);
        file_put_contents($file ? $file : $this->filePath, $iniString);
    }
739718
public function write($content, $level)
    {
        $this->message = (string) $content;
        $this->level   = $level;

        if ( is_callable($this->writeBeforeHandle) )
        {
            $this->writeBefore($this->writeBeforeHandle);

            if (!$this->customMessageFormatParser)
            {
                $this->defaultMessageFormatReplaces();
            }
        }
        else
        {
            $this->defaultMessageFormatReplaces();
        }

        $this->messageFormatParser();

        if ( !$this->resource )
        {
            $this->filename = date($this->dateFormat);

            if ( !empty($this->extension) )
            {
                $this->filename .= '.' . $this->extension;
            }

            $this->resource = fopen($this->path . DIRECTORY_SEPARATOR . $this->filename, 'a');
        }

        fwrite($this->resource, $this->messageOutput . PHP_EOL);
    }
883092
protected function save($content, $path)
    {
        $handler = $this->openFileForWriting($path);

        $this->writeToFile($handler, $content);

        @fclose($handler);
    }