is_writable

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Tells whether the filename is writable
Alias is_writeable
<?php is_writable(string $filename): bool
<?php     public function isWritable($path)

    {

        return is_writable($path);

    }
<?php     protected function write(array $manifest)

    {

        if (! is_writable($dirname = dirname($this->manifestPath))) {

            throw new Exception("The {$dirname} directory must be present and writable.");

        }
<?php     public function writeManifest($manifest)

    {

        if (! is_writable($dirname = dirname($this->manifestPath))) {

            throw new Exception("The {$dirname} directory must be present and writable.");

        }
<?php     public function writeProcessId(int $masterProcessId): void

    {

        if (! is_writable($this->path) && ! is_writable(dirname($this->path))) {

            throw new RuntimeException('Unable to write to process ID file.');

        }
<?php     public function writeState(array $newState): void

    {

        if (! is_writable($this->path) && ! is_writable(dirname($this->path))) {

            throw new RuntimeException('Unable to write to process ID file.');

        }
<?php     public function delete(): bool

    {

        if (is_writable($this->path)) {

            return unlink($this->path);

        }
<?php     public function writeProcessIds(int $masterProcessId, int $managerProcessId): void

    {

        if (! is_writable($this->path) && ! is_writable(dirname($this->path))) {

            throw new RuntimeException('Unable to write to process ID file.');

        }
<?php     public function writeState(array $newState): void

    {

        if (! is_writable($this->path) && ! is_writable(dirname($this->path))) {

            throw new RuntimeException('Unable to write to process ID file.');

        }
<?php     public function delete(): bool

    {

        if (is_writable($this->path)) {

            return unlink($this->path);

        }
<?php             if (

                (!is_dir($this->root) && !Silencer::call('mkdir', $this->root, 0777, true))

                || !is_writable($this->root)

            ) {

                $this->io->writeError('<warning>Cannot create cache directory ' . $this->root . ', or directory is not writable. Proceeding without cache</warning>');

                $this->enabled = false;
<?php         if (!is_writable($this->file) && !Silencer::call('file_put_contents', $this->file, $this->composerBackup)) {

            $io->writeError('<error>'.$this->file.' is not writable.</error>');



            return 1;
<?php         }




        $tmpDir = is_writable(dirname($localFilename)) ? dirname($localFilename) : $cacheDir;




        if (!is_writable($tmpDir)) {
<?php         $tmpDir = is_writable(dirname($localFilename)) ? dirname($localFilename) : $cacheDir;




        if (!is_writable($tmpDir)) {

            throw new FilesystemException('Composer update failed: the "'.$tmpDir.'" directory used to download the temp file could not be written');

        }
<?php             return true;

        } catch (\Exception $e) {


            if (!is_writable(dirname($localFilename))

                && $io->isInteractive()

                && $this->isWindowsNonAdminUser()) {

                return $this->tryAsWindowsAdmin($localFilename, $newFilename);
<?php         $fallback = array_pop($args);



        if ($this->file->exists()) {

            if (!is_writable($this->file->getPath())) {

                throw new \RuntimeException(sprintf('The file "%s" is not writable.', $this->file->getPath()));

            }