Command line function for deleting files.
    For more information visit
    :func:`delete_file<ohapi.api.delete_file>`.
346506
def delete_cli(access_token, project_member_id, base_url=OH_BASE_URL,
               file_basename=None, file_id=None, all_files=False):
    
    response = delete_file(access_token, project_member_id,
                           base_url, file_basename, file_id, all_files)
    if (response.status_code == 200):
        print("File deleted successfully")
    else:
        print("Bad response while deleting file.")
944582
def remove_file(self, file_name, *args, **kwargs):
		
		previous_path = self.session_path()
		try:
			self.session_path(file_name)
			os.unlink(self.full_path())
		finally:
			self.session_path(previous_path)
1239716
public static boolean deleteFile(File file) throws IOException {
		if (file.isDirectory()) {
			throw new IOException("File " + file + " isn't a file.");
		}
		if (!file.delete()) {
			if (System.getProperty("os.name").equalsIgnoreCase("windows")) {
				file = file.getCanonicalFile();
				System.gc();
			}
			try {
				Thread.sleep(10);
				return file.delete();
			} catch (InterruptedException ex) {
				return file.delete();
			}
		}
		return true;
	}
1212967
def file_delete(filename, settings):
        
        if len(settings) != 1:
            raise ValueError("Settings must only contain one item with key "
                             "'mode'.")
        for k, v in settings.items():
            if k == "mode" and v == "actual":
                try:
                    os.remove(filename)
                except OSError:
                    #Skip file not found error.
                    pass
            elif k == "mode" and v == "simulated":
                print("Simulated removal of {}".format(filename))
1087430
def delete(filething):
    

    t = OggSpeex(filething)
    filething.fileobj.seek(0)
    t.delete(filething)
633562
def delete_archive_file(self):
        
        logger.debug("Deleting %s", self.archive_tmp_dir)
        shutil.rmtree(self.archive_tmp_dir, True)
313009
public DeleteMOHFilesResponse deleteMOHFiles(String fileName) throws ApiException {
        ApiResponse<DeleteMOHFilesResponse> resp = deleteMOHFilesWithHttpInfo(fileName);
        return resp.getData();
    }
61060
public static boolean delete(File f) throws IOException
	{
		assert (f.exists());

		if (f.isDirectory())
		{
			FileUtils.deleteDirectory(f);
			return true;
		}
		else
		{
			return f.delete();
		}
	}
1204272
public static boolean delete(File file) {
        boolean result = false;
        if (file.exists()) {
            result = file.delete();
            if (!result) {
                logger.info("delete " + file.getName() + " error");
            }
        }
        return result;
    }
799995
def remove_files_in_dir(dpath, fname_pattern_list='*', recursive=False,
                        verbose=VERBOSE, dryrun=False, ignore_errors=False):
    
    if isinstance(fname_pattern_list, six.string_types):
        fname_pattern_list = [fname_pattern_list]
    if verbose > 2:
        print('[util_path] Removing files:')
        print('  * from dpath = %r ' % dpath)
        print('  * with patterns = %r' % fname_pattern_list)
        print('  * recursive = %r' % recursive)
    num_removed, num_matched = (0, 0)
    if not exists(dpath):
        msg = ('!!! dir = %r does not exist!' % dpath)
        if verbose:
            print(msg)
        warnings.warn(msg, category=UserWarning)
    for root, dname_list, fname_list in os.walk(dpath):
        for fname_pattern in fname_pattern_list:
            for fname in fnmatch.filter(fname_list, fname_pattern):
                num_matched += 1
                num_removed += remove_file(join(root, fname),
                                           ignore_errors=ignore_errors,
                                           dryrun=dryrun,
                                           verbose=verbose > 5)
        if not recursive:
            break
    if verbose > 0:
        print('[util_path] ... Removed %d/%d files' % (num_removed, num_matched))
    return True
688595
def delete_object_from_file(file_name, save_key, file_location):
    
    file = __os.path.join(file_location, file_name)
    shelve_store = __shelve.open(file)
    del shelve_store[save_key]
    shelve_store.close()
29143
def delete(self):
        
        fcid = None
        pid = None

        if isinstance(self, File):
            fcid = self.fid
            pid = self.cid
        elif isinstance(self, Directory):
            fcid = self.cid
            pid = self.pid
        else:
            raise APIError('Invalid BaseFile instance.')

        if not self._deleted:
            if self.api._req_rb_delete(fcid, pid):
                self._deleted = True
                return True
        else:
            raise APIError('This file or directory is already deleted.')
1033828
def _remove(self, n):
        
        if os.path.isfile(n):
            os.remove(n)
        if not os.path.isfile(n):
            print("File '{0}' removed".format(n))
1274277
public static void deleteFile(@Nonnull File f) throws IOException {
        newPathRemover(PathRemover.PathChecker.ALLOW_ALL).forceRemoveFile(fileToPath(f));
    }
74363
def delete(self, filename=''):
        
        self._raise_if_none()
        fn = path_join(self.path, filename)

        try:
            if isfile(fn):
                remove(fn)
            else:
                removedirs(fn)
        except OSError as why:
            if why.errno == errno.ENOENT:
                pass
            else:
                raise why
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))
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)