Deletes a file from the store.

   layer.delete("documents", hash)

 Returns true if the file was deleted, or false if it could not be found.
 Raises an error if the layer is readonly.
177297
def delete(type, hash)
      raise Dis::Errors::ReadOnlyError if readonly?
      delete!(type, hash)
    end
295799
def delete(self, id):
        
        res = self._api_request('del', data={'i': id})[0]
        if res[0] == '-1':
            raise PuushError("File deletion failed.")
709909
public static boolean deleteOrDie(@Nonnull final String file) throws IOException {
        // this returns true if the file was actually deleted
        // and false for 2 cases:
        //   1. file did not exist to start with
        //   2. File.delete() failed at some point for some reason
        // so we disambiguate the 'false' case below by checking for file existence
        final boolean fileWasDeleted = delete(file);

        if (fileWasDeleted) {
            // file was definitely deleted
            return true;
        } else {
            final File fileObj = new File(file);
            if (fileObj.exists()) {
                throw new IOException("File still exists after erasure, cannot write object to file: " + file);
            }

            // file was not deleted, because it does not exist
            return false;
        }
    }
432747
def delete(self, file_, delete_file=True):
        
        image_file = ImageFile(file_)
        if delete_file:
            image_file.delete()
        default.kvstore.delete(image_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
41075
def delete(item)
      data = read_file
      match_name(item)
      data.delete(@@item)
      write_file(data)
    end
180121
async def delete(self, key):
        
        try:
            async with self._client.delete(self.path_keys(key)) as r:
                if r.status not in [204, 404]:
                    return False
                return True
        except ContentEncodingError:
            """ Not error really """
            return True
        except:
            raise
1037910
def remove_file(filename, verbose=True):
    
    if verbose:
        LOG.info('Deleting file %s', os.path.relpath(filename, config.BASE_DIR))
    if not os.path.exists(filename):
        LOG.warning("File does not exist: %s", os.path.relpath(filename, config.BASE_DIR))
    else:
        os.remove(filename)
672718
def delete_file(self, id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - id
        """ID"""
        path["id"] = id

        self.logger.debug("DELETE /api/v1/files/{id} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("DELETE", "/api/v1/files/{id}".format(**path), data=data, params=params, no_data=True)
1003214
def delete_blob(call=None, kwargs=None):  # pylint: disable=unused-argument
    '''
    
    '''
    if kwargs is None:
        kwargs = {}

    if 'container' not in kwargs:
        raise SaltCloudSystemExit(
            'A container must be specified'
        )

    if 'blob' not in kwargs:
        raise SaltCloudSystemExit(
            'A blob must be specified'
        )

    storageservice = _get_block_blob_service(kwargs)

    storageservice.delete_blob(kwargs['container'], kwargs['blob'])
    return True
1265615
def delete(filething):
    

    t = OggFLAC(filething)
    filething.fileobj.seek(0)
    t.delete(filething)
730400
def delete(self, bucket: str, key: str):
        
        bucket_obj = self._ensure_bucket_loaded(bucket)
        try:
            bucket_obj.delete_blob(key)
        except NotFound:
            return False
1087430
def delete(filething):
    

    t = OggSpeex(filething)
    filething.fileobj.seek(0)
    t.delete(filething)
64247
def delete_file(self, uri, purge=False):
        
        try:
            resource = self.get_resource_by_uri(uri)
        except ResourceNotFoundError:
            # Nothing to remove
            return None

        if not isinstance(resource, File):
            raise ValueError("File expected, got {}".format(type(resource)))

        if purge:
            func = self.api.file_purge
        else:
            func = self.api.file_delete

        return func(resource['quickkey'])
423906
def remove(self, filter_=None, **kwargs):
        
        if isinstance(filter_, dict) and filter_ == {}:
            raise ValueError('not allowed remove all documents')

        if filter_ is None:
            raise ValueError('not allowed remove all documents')

        if kwargs.pop('multi', False) is True:
            return self.__collect.delete_many(filter_, **kwargs)
        else:
            return self.__collect.delete_one(filter_, **kwargs)
1155854
def _remove_files(self, predicate):
        
        found = False
        for i in range(len(self.files) - 1, -1, -1):
            if predicate(self.files[i]):
                self.debug_print(" removing " + self.files[i])
                del self.files[i]
                found = True
        return found
382493
def delete_by_hash(self, file_hash):
        
        full_path = self.file_path_from_hash(file_hash)

        return self.delete_by_path(full_path)