Saves shapefile.

@param string|null $FileName Name of file, otherwise existing is used
192437
public function saveToFile($FileName = null)
    {
        if (! is_null($FileName)) {
            $this->FileName = $FileName;
        }

        if (($this->_openSHPFile(true)) && ($this->_openSHXFile(true)) && ($this->_createDBFFile())) {
            $this->_saveHeaders();
            $this->_saveRecords();
            $this->_closeSHPFile();
            $this->_closeSHXFile();
            $this->_closeDBFFile();
        } else {
            return false;
        }
    }
1301306
public static function save( $fileName, $data )
	{
		$yaml	= FS_File_YAML_Spyc::YAMLDump( $data );
		return FS_File_Writer::save( $fileName, $yaml );
	}
477187
function saveFile() {
      if (currentFile) {
        if (!currentFile.oldName) {
          currentFile.oldName = possibleOldName;
        }

        if (!currentFile.newName) {
          currentFile.newName = possibleNewName;
        }

        if (currentFile.newName) {
          files.push(currentFile);
          currentFile = null;
        }
      }

      possibleOldName = undefined;
      possibleNewName = undefined;
    }
563720
public function save($data = null)
    {
        if ($data !== null) {
            $this->content($data);
        }

        $filename = $this->filename;
        $dir = \dirname($filename);

        if (!$this->mkdir($dir)) {
            throw new \RuntimeException('Creating directory failed for ' . $filename);
        }

        try {
            if ($this->handle) {
                $tmp = true;
                // As we are using non-truncating locking, make sure that the file is empty before writing.
                if (@ftruncate($this->handle, 0) === false || @fwrite($this->handle, $this->raw()) === false) {
                    // Writing file failed, throw an error.
                    $tmp = false;
                }
            } else {
                // Create file with a temporary name and rename it to make the save action atomic.
                $tmp = $this->tempname($filename);
                if (file_put_contents($tmp, $this->raw()) === false) {
                    $tmp = false;
                } elseif (@rename($tmp, $filename) === false) {
                    @unlink($tmp);
                    $tmp = false;
                }
            }
        } catch (\Exception $e) {
            $tmp = false;
        }

        if ($tmp === false) {
            throw new \RuntimeException('Failed to save file ' . $filename);
        }

        // Touch the directory as well, thus marking it modified.
        @touch($dir);
    }
237369
protected function dumpFile(string $filename)
    {

        if (strlen($filename) > 0 && file_exists($filename) && is_file($filename)) {
            echo file_get_contents($filename);
            return true;
        }

        return false;
    }
738368
public function save($fileName, $values, $map = null) {
		if ($map !== null) {
			$output = $this->createOutputWithMap($values,$map);
		} else {
			$output = $this->createOutput($values);
		}

		$this->saveToFile($fileName, $output);
	}
162568
public function save($content, $fileName) {
        $this->renderer = new Png();
        $this->renderer->setHeight($this->width);
        $this->renderer->setWidth($this->height);
        $writer = new Writer($this->renderer);

        $writer->writeFile($content, $fileName);

        return true;
    }
251340
public function setFileName( $fileName ){
		$this->fileName	= $fileName;
		$this->sheet	= self::load( $fileName );
	}
1229965
public function save(string $fileName = null)
    {
        if (is_null($fileName)) {
            $fileName = self::FILENAME_CONFIG_DEFAULT;
        }

        $saved = file_put_contents($fileName, $this->toJson());

        if ($saved === false) {
            throw new BunqException(self::ERROR_COULD_NOT_SAVE_THE_API_CONTEXT, [$fileName]);
        }
    }
632168
private function prepareFilename($filename)
    {
        $this->filename = $filename;

        if (!$this->filename) {
            $this->filename = $this->content->getMetadata('uri');
        }

        if (!$this->filename || substr($this->filename, 0, 6) === 'php://') {
            $this->filename = $this->name;
        }
    }
722806
public function toFile($filename)
    {
        $directory = dirname($filename);

        if(empty($filename)) {
            throw new \InvalidArgumentException('No file name specified');
        }

        if (!is_dir($directory)) {
            throw new \RuntimeException(sprintf('Directory : %s does not exists!', $directory));
        }

        if (!is_writable($directory)) {
            throw new \RuntimeException(sprintf("Cannot write in directory : %s", $directory));
        }

        $result = file_put_contents($filename, $this->toString(), LOCK_EX);

        if($result === false) {
            throw new \RuntimeException(sprintf("Error writing to %s", $filename));
        }
    }
506535
public function save(string $filename): TextToSpeechInterface
    {
        $result = file_put_contents($filename, $this->getAudioData());

        if ($result === false) {
            throw new RuntimeException("Unable to save the file ({$filename})");
        }

        return $this;
    }
422457
public function save( $fileName = NULL )
	{
		if( empty( $fileName ) )
		{
			if( empty( $this->fileName ) )
				throw new Exception( 'No TAR file name for saving given' );
			$fileName = $this->fileName;
		}
		$this->generateZip();																		// Encode processed files into TAR file format
		return File_Writer::save( $fileName, $this->content );										//  write archive file
	}
1273337
@GwtIncompatible("com.google.io.Files")
  public void save(String filename) throws IOException {
    Files.write(toBytes(), new File(filename));
  }
1135914
protected function setFilenameOption($filename): void
    {
        if (is_string($filename)) {
            $filename = new BasicFilename($filename);
        }

        if (!is_callable($filename)) {
            throw new TypeError("Filename should be a string or callable");
        }

        $this->filename = $filename;
    }
843705
public function setFileName($fileName)
    {
        $this->fileName = $fileName;
        $this->setContentType(mime_content_type($this->fileName));
    }
571942
public function saveHtml($filename, $base = null)
    {
        $this->ensureWritableDirectory(dirname($filename));

        $html = new Html($this->getHtml());

        if (null !== $base) {
            $html->resolveLinks(\GuzzleHttp\Psr7\uri_for($base));
        }

        file_put_contents($filename, $html->get());

        return $this;
    }