Create an audio file on the filesystem.

@param string $filename The filename to write to

@return $this
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;
    }
651660
public function setFilename($filename)
    {
        $filename = $this->filterFilename($filename);

        // Check existing folder path
        $folder = '';
        $parent = $this->Parent();
        if ($parent && $parent->exists()) {
            $folder = $parent->getFilename();
        }

        // Detect change in foldername
        $newFolder = ltrim(dirname(trim($filename, '/')), '.');
        if ($folder !== $newFolder) {
            if (!$newFolder) {
                $this->ParentID = 0;
            } else {
                $parent = Folder::find_or_make($newFolder);
                $this->ParentID = $parent->ID;
            }
        }

        // Update base name
        $this->Name = basename($filename);
        return $this;
    }
546733
public function fromFile($filename)
    {
        $xml = $this->createDomDocument();
        $xml->load($filename);

        return new Document($xml);
    }
313932
public function addFilename($filename)
    {

        $item = new ZipFileItem();
        $item->orginalFilename = $filename;
        $item->internalFilename = (new File($filename))->filename;
        $this->fileItemList[] = $item;

        return $this;

    }
1227561
public function goReadFile(string $filename)
    {
        $this->__filename  = $filename;
        $this->__type      = self::READ_FILE;

        $this->requestId   = $this->getContext()->getRequestId();
        $requestId         = $this->requestId;

        getInstance()->scheduler->IOCallBack[$this->requestId][] = $this;
        $keys = array_keys(getInstance()->scheduler->IOCallBack[$this->requestId]);
        $this->ioBackKey = array_pop($keys);

        $this->send(function ($filename, $content) use ($requestId) {
            if (empty($this->getContext()) || ($requestId != $this->getContext()->getRequestId())) {
                return;
            }

            if (empty(getInstance()->scheduler->taskMap[$this->requestId])) {
                return;
            }

            $this->result = $content;
            $this->ioBack = true;
            $this->nextRun();
        });

        return $this;
    }
272157
public function generate( $fileName ){
		$word	= $this->generateWord();
		$this->generateImage( $word, $fileName );
		return $word;
	}
650037
protected function extend( string$fileName ):self
	{
		$this->parent= new static($this->htsl,$this->buffer->goSide($fileName));

		$this->docType= $this->parent->docType;
		$this->indentation= $this->parent->indentation;

		return $this;
	}
654826
protected function makeFile($filename, $content, $force)
    {
        if ($this->fileExists($filename, $force)) {
            throw new Exception('The destination file already exists. To override the existing file, pass "--force" option.');
        }

        if (!File::put($filename, $content)) {
            throw new Exception('Unexpected error occurred while trying to create the file. please try your request again.');
        }

        return $this;
    }
697162
public function setFileName($filename)
  {
    if ($this->isLocked()) {
      return $this->getObj()->setFileName($filename)->setLocked();
    } else {
      return parent::setFileName($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;
    }
913455
public function create($fileName, $data)
    {
        $path = $this->getPathBase($fileName);

        if (file_exists($path)) {
            return;
        }

        $data = serialize($data);

        return file_put_contents($path, $data);
    }
784851
public static function create( $slug, $filename = '' ) {
		// Use the calling file as the main plugin file.
		if ( empty( $filename ) ) {
			$backtrace = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT, 1 );
			$filename = $backtrace[0]['file'];
		}

		return ( new Plugin() )
			->set_basename( plugin_basename( $filename ) )
			->set_directory( plugin_dir_path( $filename ) )
			->set_file( $filename )
			->set_slug( $slug )
			->set_url( plugin_dir_url( $filename ) );
	}
843705
public function setFileName($fileName)
    {
        $this->fileName = $fileName;
        $this->setContentType(mime_content_type($this->fileName));
    }
1242873
public function saveFile($filename, array $params = [])
    {
        $fp = fopen($filename, 'w');
        fwrite($fp, $this->xmlString($params));
        fclose($fp);

        return $this;
    }
485289
protected function writeCache( $fileName )
	{
		$file		= new FS_File_Writer( $fileName, 0777 );
		$content	= serialize( $this->getConfigValues() );
		$file->writeString( $content );
		touch( $fileName, filemtime( $this->pathConfig.$this->fileName ) );
	}
623671
public function save($filename)
    {
        $type = pathinfo($filename, PATHINFO_EXTENSION);
        $type = ($type === 'jpg') ? 'jpeg' : $type;
        $type = (in_array($type, $this->imageTypes)) ? $type : 'png';

        header('Content-type: image/' . $type);

        $imageFunc = 'image' . $type;
        $imageFunc($this->image, $filename);

        $this->destroy($this->image);

        return $this;
    }
535565
private function createConfigurationFile($filename)
    {
        $absFilename = GeneralUtility::getFileAbsFileName($filename);
        if (file_exists($absFilename)) {
            // Add Flashmessage that there is already an configuration file and we are not going to override this.
            $flashMessage = GeneralUtility::makeInstance(
                FlashMessage::class,
                'There is already an ' . $filename . ' configuration file in the root directory, '
                . 'please make sure that configuration files are protected and the url rewritings are set properly. '
                . 'An example configuration is located at: "typo3conf/ext/bootstrap_package/Configuration/Server/_' . $filename . '"',
                'Webserver configuration file "' . $filename . '" already exists',
                FlashMessage::NOTICE,
                true
            );
            $this->addFlashMessage($flashMessage);
            return;
        }

        $filecontent = GeneralUtility::getUrl(ExtensionManagementUtility::extPath(self::EXT_KEY) . '/Configuration/Server/_' . $filename);
        if ($filecontent && is_string($filecontent)) {
            GeneralUtility::writeFile($absFilename, $filecontent, true);
            // Add Flashmessage that the example configuration file was placed in the root directory
            $flashMessage = GeneralUtility::makeInstance(
                FlashMessage::class,
                'For securing configuration files and optimization purposes an example ' . $filename . ' file was placed in your root directory.',
                'Webserver configuration file "' . $filename . '" was placed in the root directory.',
                FlashMessage::OK,
                true
            );
            $this->addFlashMessage($flashMessage);
        }
    }