Delete file with given uuid.

        :param:uuid: :class:`UUID` instance
        :raises:KeyError if file does not exists
325703
def delete(self, uuid):
        # type: (UUID) -> None
        
        dest = self.abs_path(uuid)
        if not dest.exists():
            raise KeyError("No file can be found for this uuid", uuid)

        dest.unlink()
405635
def open_file(uuid, path):
     
     # create temporary file just so we can get an unused file path
     f = tempfile.NamedTemporaryFile()
     f.close()  # close and delete right away
     fname = f.name

     # download file to temporary path
     cmd ='cl down -o {} -w {} {}/{}'.format(fname, worksheet, uuid, path)
     try:
        shell(cmd)
     except RuntimeError:
         try:
            os.remove(fname)  # if file exists, remove it
         except OSError:
             pass
         raise IOError('Failed to open file {}/{}'.format(uuid, path))

     f = open(fname)
     yield f
     f.close()
     os.remove(fname)
1128067
def _delete_file(fileName, n=10):
    """"""
    status = False
    count = 0
    while not status and count < n:
        try:
            _os.remove(fileName)
        except OSError:
            count += 1
            _time.sleep(0.2)
        else:
            status = True
    return status
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()
85989
def delete(key, parameters = {})
      if File.file?(path = pathify(key, parameters))
        FileUtils.rm(path)
      end
    end
279667
def delete_file(f):
    
    fp = f.get_fullpath()
    log.info("Deleting file %s", fp)
    os.remove(fp)
1294477
def delete(path, dryrun=False, recursive=True, verbose=None, print_exists=True,
           ignore_errors=True):
    
    if verbose is None:
        verbose = VERBOSE
        if not QUIET:
            verbose = 1
    if verbose > 0:
        print('[util_path] Deleting path=%r' % path)
    exists_flag = exists(path)
    link_flag = islink(path)
    if not exists_flag and not link_flag:
        if print_exists and verbose:
            print('..does not exist!')
        flag = False
    else:
        rmargs = dict(verbose=verbose > 1, ignore_errors=ignore_errors,
                      dryrun=dryrun)
        if islink(path):
            os.unlink(path)
            flag = True
        elif isdir(path):
            # First remove everything in the directory
            flag = remove_files_in_dir(path, recursive=recursive, **rmargs)
            # Then remove the directory itself
            flag = flag and remove_dirs(path, **rmargs)
        elif isfile(path):
            flag = remove_file(path, **rmargs)
        else:
            raise ValueError('Unknown type of path=%r' % (path,))
        if verbose > 0:
            print('[util_path] Finished deleting path=%r' % path)
    return flag
783587
def file_delete(context, id, file_id):
    
    component.file_delete(context, id=id, file_id=file_id)
924782
def files_delete(self, *, id: str, **kwargs) -> SlackResponse:
        
        kwargs.update({"id": id})
        return self.api_call("files.delete", json=kwargs)
1326
def delete(filething):
    

    dsf_file = DSFFile(filething.fileobj)

    if dsf_file.dsd_chunk.offset_metdata_chunk != 0:
        id3_location = dsf_file.dsd_chunk.offset_metdata_chunk
        dsf_file.dsd_chunk.offset_metdata_chunk = 0
        dsf_file.dsd_chunk.write()

        filething.fileobj.seek(id3_location)
        filething.fileobj.truncate()
827357
def deleteinputfile(project, filename, credentials=None):
        """"""

        user, oauth_access_token = parsecredentials(credentials) #pylint: disable=unused-variable
        filename = filename.replace("..","") #Simple security

        if len(filename) == 0:
            #Deleting all input files
            shutil.rmtree(Project.path(project, user) + 'input')
            os.makedirs(Project.path(project, user) + 'input') #re-add new input directory
            return "Deleted" #200
        elif os.path.isdir(Project.path(project, user) + filename):
            #Deleting specified directory
            shutil.rmtree(Project.path(project, user) + filename)
            return "Deleted" #200
        else:
            try:
                file = clam.common.data.CLAMInputFile(Project.path(project, user), filename)
            except:
                raise flask.abort(404)

            success = file.delete()
            if not success:
                raise flask.abort(404)
            else:
                msg = "Deleted"
                return withheaders(flask.make_response(msg),'text/plain', {'Content-Length': len(msg), 'allow_origin': settings.ALLOW_ORIGIN})
210765
def file_del(self, key, paths=None):
        
        if paths is None:
            paths = []
            for path in self._file_event_map:
                if key in self._file_event_map[path]:
                    paths.append(path)
        elif not isinstance(paths, list):
            paths = [paths]
        for path in paths:
            if key in self._file_event_map[path]:
                del self._file_event_map[path][key]
            if path in self._file_event_map and not self._file_event_map[path]:
                self._watch_files.remove(path)
                del self._file_event_map[path]
1132946
def delete(self, filething=None):
        

        fileobj = filething.fileobj

        self.tags.clear()
        # TODO: we should delegate the deletion to the subclass and not through
        # _inject.
        try:
            try:
                self.tags._inject(fileobj, lambda x: 0)
            except error as e:
                reraise(self._Error, e, sys.exc_info()[2])
            except EOFError:
                raise self._Error("no appropriate stream found")
        except IOError as e:
            reraise(self._Error, e, sys.exc_info()[2])
102486
def remove_file(self, file_name, *args, **kwargs):
		
		client = self.dav_client()
		remote_path = self.join_path(self.session_path(), file_name)
		if client.is_dir(remote_path) is True:
			raise ValueError('Unable to remove non-file entry')
		client.clean(remote_path)
1196668
def delete(self, uri):
        
        try:
            self.connect(uri, method='DELETE')
            return True
        except urllib.error.HTTPError:
            return False
1082137
def delete_file(f, ignore_errors=False):
	
	try:
		os.remove(f)
	except Exception as ex:
		if ignore_errors:
			return
		print('ERROR deleting file ' + str(ex))
710702
def delete(self, *args, **kwargs):
        
        file_obj = self.file
        super(AssetBase, self).delete(*args, **kwargs)
        self.delete_real_file(file_obj)