DELETE /images/1
 DELETE /images/1.xml
515971
def destroy
      @image = Cmtool::Image.find(params[:id])
      directory = @image.directory
      @image.destroy

      respond_to do |format|
        format.html { redirect_to([cmtool, directory || :images]) }
        format.xml  { head :ok }
      end
    end
1025095
private function actionDelete()
    {
        $baseName = substr($this->path, 0, strrpos($this->path, '.'));
        $files = glob($baseName . '.*');
        if (!is_array($files))
        {
            $files = array();
        }
        $files2 = glob($baseName . '-*');
        if (!is_array($files2))
        {
            $files2 = array();
        }

        $files = array_merge($files, $files2);

        foreach ($files as $file)
        {
            @unlink($file);
        }
    }
705258
public function afterDelete()
    {
        parent::afterDelete();

        foreach ($this->getAttributes() as $attribute => $value){
            if($this->hasValidator(['image', 'file'], $attribute)) {
                @unlink(Yii::getAlias('@webroot').$this->$attribute);
            }
        }
    }
443861
protected function cleanup()
    {
        $this->filesystem->remove($this->tmpFolder);
        $this->root = null;
        $this->urlsets = array();
    }
1350489
def delete_thumbnails(relative_source_path, root=None, basedir=None,
                      subdir=None, prefix=None):
    
    thumbs = thumbnails_for_file(relative_source_path, root, basedir, subdir,
                                 prefix)
    return _delete_using_thumbs_list(thumbs)
762404
def delete(nsc, uri, content_type = CONTENT_TYPE::XML)
      delete = Net::HTTP::Delete.new(uri)
      delete.set_content_type(content_type)
      request(nsc, delete)
    end
594045
def delete_config_dir
      begin
        FileUtils.rm_r(config_dir) if dir_exists?

      rescue StandardError => e
        raise FileAccessError, e.message
      end
    end
152259
public function removePortraitImage()
    {
        $sizes = $this->_mixer->getValue('sizes');

        if (empty($sizes)) {
            $sizes = explode(' ', 'original large medium small thumbnail square');
        } else {
            $sizes = array_keys($sizes);
        }

        foreach ($sizes as $size) {
            $file = $this->_mixer->getPortraitFile($size);
            $this->_mixer->deletePath($file);
        }

        $this->set('filename', null);
    }
1294234
function delete($path) {
        $this->_path = $this->translate_uri($path);
        $this->header_unset();
        $this->create_basic_request('DELETE');
        /* $this->header_add('Content-Length: 0'); */
        $this->header_add('');
        $this->send_request();
        $this->get_respond();
        $response = $this->process_respond();

        // validate the response ...
        // check http-version
        if ($response['status']['http-version'] == 'HTTP/1.1' ||
            $response['status']['http-version'] == 'HTTP/1.0') {
                // seems to be http ... proceed
                // We expect a 207 Multi-Status status code
                // print 'http ok<br>';

                switch ($response['status']['status-code']) {
                case 207:
                    // collection was NOT deleted... see xml response for reason...
                    // next there should be a Content-Type: text/xml; charset="utf-8" header line
                    if (strcmp($response['header']['Content-Type'], 'text/xml; charset="utf-8"') == 0) {
                        // ok let's get the content of the xml stuff
                        $this->_parser = xml_parser_create_ns();
                        $this->_parserid = (int) $this->_parser;
                        // forget old data...
                        unset($this->_delete[$this->_parserid]);
                        unset($this->_xmltree[$this->_parserid]);
                        xml_parser_set_option($this->_parser,XML_OPTION_SKIP_WHITE,0);
                        xml_parser_set_option($this->_parser,XML_OPTION_CASE_FOLDING,0);
                        xml_set_object($this->_parser, $this);
                        xml_set_element_handler($this->_parser, "_delete_startElement", "_endElement");
                        xml_set_character_data_handler($this->_parser, "_delete_cdata");

                        if (!xml_parse($this->_parser, $response['body'])) {
                            die(sprintf("XML error: %s at line %d",
                                xml_error_string(xml_get_error_code($this->_parser)),
                                xml_get_current_line_number($this->_parser)));
                        }

                        print "<br>";

                        // Free resources
                        xml_parser_free($this->_parser);
                        $this->_delete[$this->_parserid]['status'] = $response['status']['status-code'];
                        return $this->_delete[$this->_parserid];

                    } else {
                        print 'Missing Content-Type: text/xml header in response.<br>';
                    }
                    return false;

                default:
                    // collection or file was successfully deleted
                    $this->_delete['status'] = $response['status']['status-code'];
                    return $this->_delete;


                }
            }

    }
235374
public function deleteFiles()    {
        $fileName = $this->_model->{$this->attribute};
        if (! empty($fileName)) {

            $size = $this->cropSize;

            if ($this->sizeSteps && $size > 0)    {
                $minSize = $size >> ($this->sizeSteps - 1);
                while ($size >= $minSize)  {
                    $path = $this->imgBaseDir . DIRECTORY_SEPARATOR . $size . DIRECTORY_SEPARATOR . $fileName;
                    if (file_exists($path)) unlink($path);

                    $size >>= 1;
                }
            }
            else    {
                $path = $this->imgBaseDir . DIRECTORY_SEPARATOR . $fileName;
                if (file_exists($path)) unlink($path);
            }
            $this->_model->{$this->attribute} = null;
            if (! is_numeric($this->aspectRatio)) $this->_model->{$this->aspectRatio} = null;
        }
    }
893967
protected function afterDelete() 
	{
		parent::afterDelete();
		//delete article image
		$banner_path = "public/banner";
		
		if($this->banner_filename != '' && file_exists($banner_path.'/'.$this->banner_filename))
			rename($banner_path.'/'.$this->banner_filename, 'public/banner/verwijderen/'.$this->banner_id.'_'.$this->banner_filename);
	}
293028
def destroy
      @faq = Cmtool::Faq.find(params[:id])
      @faq.destroy

      respond_to do |format|
        format.html { redirect_to(cmtool.faqs_url) }
        format.xml  { head :ok }
      end
    end
1129640
protected function deleteImagesProduct()
    {
        $this->controlAccess('product_edit');

        $file_ids = $this->getPosted('delete_images', array(), true, 'array');
        return $this->image->delete($file_ids);
    }
515940
public static function deleteHtAccessFiles()
    {
        $files = Filesystem::globr(PIWIK_INCLUDE_PATH, ".htaccess");

        // that match the list of directories we create htaccess files
        // (ie. not the root /.htaccess)
        $directoriesWithAutoHtaccess = array(
            '/js',
            '/libs',
            '/vendor',
            '/plugins',
            '/misc/user',
            '/config',
            '/core',
            '/lang',
            '/tmp',
        );

        foreach ($files as $file) {
            foreach ($directoriesWithAutoHtaccess as $dirToDelete) {
                // only delete the first .htaccess and not the ones in sub-directories
                $pathToDelete = $dirToDelete . '/.htaccess';
                if (strpos($file, $pathToDelete) !== false) {
                    @unlink($file);
                }
            }
        }
    }
1115605
def delete():
    """"""
    path = cache.local_path(
        filename=ALLELE_XML_FILENAME,
        url=ALLELE_XML_URL,
        decompress=ALLELE_XML_DECOMPRESS)
    os.remove(path)
889832
def delete(self, image_file, delete_thumbnails=True):
        
        if delete_thumbnails:
            self.delete_thumbnails(image_file)
        self._delete(image_file.key)
1228446
def removeXmlElement(name, directory, file_pattern, logger=None):
    
    for path, dirs, files in os.walk(os.path.abspath(directory)):
        for filename in fnmatch.filter(files, file_pattern):
            filepath = os.path.join(path, filename)
            remove_xml_element_file(name, filepath)