Remove a file from the disk.

@return bool
766071
public function delete() : bool
    {
        $removed = null;

        if ($this->isDirectory()) {
            $removed = rmdir($this->realPath);
        } else {
            $removed = unlink($this->realPath);
        }

        return $removed;
    }
377320
public function deleteAll()
    {
        if ($this->isAbsolute()) {
            if ($this->isFile() || $this->isLink()) {
                // delete file and symlink
                return unlink($this->getPathname());
            } elseif ($this->isDir()) {
                // delete directories and its content
                return $this->deleteAction($this->getPathname(), true);
            }
            return false;
        } else {
            throw new FileException('Given file path is not a absolute path.');
        }
    }
93715
public function remove($fileName): bool
    {
        return unlink($this->fileInfo->getAbsoluteFilePath() . MDir::getSeparator() . $fileName);
    }
226595
public function deleteAll()
    {
        try {
            array_map('unlink', glob($this->filePath('*')));
        } catch (\Exception $e) {
            return false;
        }
        $this->storage = [];
        return true;
    }
988673
public function destroy()
    {
        $this->contents = [];
        $filepath = $this->getFilepath();

        if ($this->getFilesystem()->has($filepath)) {
            return $this->getFilesystem()->delete($filepath);
        }
    }
973923
public function clearFile()
    {
        $cleared = false;

        if (isset($this->file_pointer)) {
            $cleared = $this->file_pointer->ftruncate(0);
        }

        return $cleared;
    }
351767
public function close() {
		$result = fclose($this->file);
		if($result == true) {
			$this->open = false;
			return true;
		}
		return false;
	}
737108
public function close()
    {
        if($this->getType() == 'temp')
        {
            if(parent::close() == true)
            {
                //Only unlink temporary files
                if($this->getType() == 'temp') {
                    $this->unlink();
                }

                return true;
            }
        }

        if($this->getType() == 'memory') {
            return $this->flush();
        }

        return false;
    }
1038246
public function clear() {
		if ( ! $this->enabled ) {
			return false;
		}

		$finder = $this->get_finder();

		foreach ( $finder as $file ) {
			unlink( $file->getRealPath() );
		}

		return true;
	}
14125
public function deleteFile($name = null)
    {
        foreach ($this->getAllFields() as $field) {
            $path = $this->getFilePath($field, $name);
            if (!$path || !is_file($path) || !file_exists($path)) {
                continue;
            }
            unlink($path);
        }
        if ($name == $this->owner->getAttribute($this->fileField)
           && ($files = $this->getFileList())     
        ) {
            $this->owner->updateAttributes([$this->fileField => reset($files)]);
        }
        return true;
    }
458817
public function disable()
    {
        $path = $this->getStatusFilePath();
        if ($path && file_exists($path)) {
            return (bool) unlink($path);
        }
        return false;
    }
998807
public function deleteFile()
    {
        $retval = false;

        if (($nb_icontact_prospect = $this->getIContactProspect()) instanceof CNabuIContactProspect &&
            ($nb_icontact = $nb_icontact_prospect->getIContact()) instanceof CNabuIContact
        ) {
            $base_path = $nb_icontact->getBasePath();
            $filename = $base_path . DIRECTORY_SEPARATOR . $this->getFilename();

            if (file_exists($filename)) {
                unlink($filename);
                $retval = !file_exists($filename);
            }
        }

        return $retval;
    }
741255
public function flush()
    {
        if (($files = $this->getCacheFiles()) === false) {
            return false;
        }

        $result = true;
        foreach ($files as $file) {
            $result = $result && @unlink($file);
        }
        return $result;
    }
1131866
public function delete() {
		
		$log_file = glob ( $this->path . '/'.$this->fileName );

		if (! empty ( $log_file ) && File::exists ( $log_file[0] ) ) {
			return File::delete ( $log_file [0] );
		}
	}
451453
public function delete()
  {
    if ( $this->file ){
      unlink($this->file);
    }
    $this->file = false;
    return $this;
  }
986869
public function delete()
    {
        if ($this->exists) {
            if (self::where('hash', $this->hash)->where('disk', $this->disk)->count() <= 1) {
                //Physical removal of all copies of a file.
                Storage::disk($this->disk)->delete($this->physicalPath());
            }
            $this->relationships()->delete();
        }

        return parent::delete();
    }
1310493
public function remove_files() {
        $fs = get_file_storage();
        $files = $fs->get_external_files($this->id);
        foreach ($files as $storedfile) {
            $storedfile->delete();
        }
    }