Delete resource defined in file
978942
def delete_from_file(file_path)
      client_setup
      resource = OneviewSDK::Resource.from_file(@client, file_path)
      fail_nice("#{resource.class.name.split('::').last} '#{resource[:name] || resource[:uri]}' Not Found", 2) unless resource.retrieve!
      return unless options['force'] || agree("Delete '#{resource[:name]}'? [Y/N] ")
      begin
        resource.delete
        puts 'Deleted Successfully!'
      rescue StandardError => e
        fail_nice "Failed to delete #{resource.class.name.split('::').last} '#{resource[:name]}': #{e}"
      end
    rescue IncompleteResource => e
      fail_nice "Failed to delete #{resource.class.name.split('::').last} '#{resource[:name]}': #{e}"
    rescue SystemCallError => e # File open errors
      fail_nice e
    end
1080166
function onRemove( error ) {
		if ( error ) {
			debug( 'Error encountered while attempting to delete a temporary input file %s: %s', inFile, error.message );
			return done( error );
		}
		debug( 'Successfully deleted temporary input file: %s', inFile );
		if ( dest === void 0 ) {
			debug( 'Reading temporary output file: %s', outFile );
			return readFile( outFile, {'encoding':'utf8'}, onFile );
		}
		done();
	}
996912
def delete(self, filename):
        """"""

        self._failed_atoms.clear()
        self.clear()
        self.save(filename, padding=lambda x: 0)
203222
def delete(self, resource, resource_id):
        '''
        
        '''

        service_def, resource_def, path = self._get_service_information(
            resource)
        delete_path = "{0}{1}/" . format(path, resource_id)
        return self.call(path=delete_path, method="delete")
114335
private void delete(File file) {
		if (file.isDirectory()) {
			File[] children = file.listFiles();
			for (File child : children) {
				delete(child);
			}
		}
		if (!file.delete()) {
			if (!file.isDirectory()) {
				logger.warn("Unable to clean/delete file: {}", file);
			} else {
				logger.debug("Unable to clean/delete directory: {}", file);
			}
		}
	}
279667
def delete_file(f):
    
    fp = f.get_fullpath()
    log.info("Deleting file %s", fp)
    os.remove(fp)
85989
def delete(key, parameters = {})
      if File.file?(path = pathify(key, parameters))
        FileUtils.rm(path)
      end
    end
18494
def delete_file(self, file_id, file_etag=None):
		''''''
		return self( join('files', bytes(file_id)), method='delete',
			headers={'If-Match': file_etag} if file_etag else dict() )
173122
def delete_file(self, instance, sender, **kwargs):
        
        file_ = getattr(instance, self.attname)

        # If no other object of this type references the file, and it's not the
        # default value for future objects, delete it from the backend.
        query = Q(**{self.name: file_.name}) & ~Q(pk=instance.pk)
        qs = sender._default_manager.filter(query)

        if (file_ and file_.name != self.default and not qs):
            default.backend.delete(file_)
        elif file_:
            # Otherwise, just close the file, so it doesn't tie up resources.
            file_.close()
346353
def delete(self):
        
        if self.resource_uri is None:
            raise ValueError("{0} object cannot be deleted because resource_uri attribute cannot be None".format(self._meta.resource_name))

        self._meta.api.http_resource("DELETE", self.resource_uri)
41075
def delete(item)
      data = read_file
      match_name(item)
      data.delete(@@item)
      write_file(data)
    end
371522
def delete(self, data, *args):
        
        path = self.get_resource_name()
        result = self.perform_api_call(self.REST_DELETE, path, data=data)
        return result
1001305
def delete_file(self, sass_filename, sass_fileurl):
        
        if self.use_static_root:
            destpath = os.path.join(self.static_root, os.path.splitext(sass_fileurl)[0] + '.css')
        else:
            destpath = os.path.splitext(sass_filename)[0] + '.css'
        if os.path.isfile(destpath):
            os.remove(destpath)
            self.processed_files.append(sass_filename)
            if self.verbosity > 1:
                self.stdout.write("Deleted '{0}'\n".format(destpath))
1053834
def delete(cls, filename, offset=None):
        """"""
        with fileutil.opened(filename, "rb+") as file:
            if offset is None:
                file.seek(-128, 2)
            else:
                file.seek(offset)
            offset = file.tell()
            data = file.read(128)
            if data[:3] == b"TAG":
                fileutil.replace_chunk(file, offset, 128, b"", in_place=True)
463463
def delete_resource(resource_name, key, identifier_fields, profile='pagerduty', subdomain=None, api_key=None):
    '''
    

    '''
    resource = get_resource(resource_name, key, identifier_fields, profile, subdomain, api_key)
    if resource:
        if __opts__['test']:
            return 'would delete'
        # flush the resource_cache, because we're modifying a resource
        del __context__['pagerduty_util.resource_cache'][resource_name]
        resource_id = _get_resource_id(resource)
        return _query(method='DELETE', action='{0}/{1}'.format(resource_name, resource_id), profile=profile, subdomain=subdomain, api_key=api_key)
    else:
        return True
1684
def delete(self):
        """"""
        if self.isfile:
            os.remove(self.fn)
        elif self.isdir:
            shutil.rmtree(self.fn)
769476
private synchronized static void delete(File file) {
        // Check if file is directory
        if (file.isDirectory()) {
            // Get all files in the folder
            File[] files = file.listFiles();

            // Delete each file in the folder
            for (int i = 0; i < files.length; ++i) {
                delete(files[i]);
            }

            // Delete the folder
            file.delete();
        } else {
            // Delete the file if it is not a folder
            file.delete();
        }
    }