Remove one or more files
498724
def delete_files(self, ids):
        """"""

        self.check_owner()
        if not isinstance(ids, list):
            raise TypeError("You must specify list of files to delete!")
        self.conn.make_call("deleteFiles", ids)
1303172
def removeFile(inlist):
    

    if not isinstance(inlist, string_types):
    # We do have a list, so delete all filenames in list.
        # Treat like a list of full filenames
        _ldir = os.listdir('.')
        for f in inlist:
        # Now, check to see if there are wildcards which need to be expanded
            if f.find('*') >= 0 or f.find('?') >= 0:
                # We have a wild card specification
                regpatt = f.replace('?', '.?')
                regpatt = regpatt.replace('*', '.*')
                _reg = re.compile(regpatt)
                for file in _ldir:
                    if _reg.match(file):
                        _remove(file)
            else:
                # This is just a single filename
                _remove(f)
    else:
        # It must be a string then, so treat as a single filename
        _remove(inlist)
394104
def cleanup(self):
        """"""
        t = time.time()
        for noncefile in glob(self.path + '/*.nonce'):
            if os.path.getmtime(noncefile) + self.expiration > t:
                os.unlink(noncefile)
846575
def delete_files(self, selections) -> None:
        """"""
        try:
            currentpath = self.currentpath
            for selection in selections:
                name = str(selection)
                if name == 'complete':
                    continue
                if not name.endswith('.py'):
                    name += '.py'
                path = os.path.join(currentpath, name)
                os.remove(path)
        except BaseException:
            objecttools.augment_excmessage(
                f'While trying to remove the network files of '
                f'selections `{selections}`')
682479
def remove(self):
        """"""
        num, sp, newfile = 0, "", []
        if os.path.isfile(self.filename):
            with open(self.filename, "r") as r:
                oldfile = r.read().splitlines()
                for line in oldfile:
                    if self.number:
                        num += 1
                        sp = ": "
                    if self.case_ins:
                        line = line.lower()
                    if self.ignore_blank and not line:
                        newfile.append(line)
                    elif line not in newfile:
                        newfile.append(line)
                    else:
                        if (self.args[0] in self.options[4:5] or
                                self.args[0] in self.options[6:7]):
                            if num == 0:
                                num = str()
                            print("{0}{1}{2}".format(num, sp, line))
            if self.args[0] not in self.options[6:7]:
                with open(self.filename, "w") as w:
                    for line in newfile:
                        w.write(line + "\n")
        else:
            self.not_access()
55725
def remove_files(filename):
        # type: (AnyStr) -> None
        
        pattern = os.path.splitext(filename)[0] + '.*'
        for f in glob.iglob(pattern):
            os.remove(f)
1210071
function() {
        var items = _utils.getArgArray(arguments);
        if (items.length === 0) {
            throw new Error('no files specified to clean up');
        }
        items.forEach(function(item) {
            try {
                var path = (typeof item === 'string') ? item : item.path;
                _fs.unlinkSync(path);
            } catch (e) {
                // Eat the exception.
            }
        });
    }
106020
def remove(in_bam):
    
    if utils.file_exists(in_bam):
        utils.remove_safe(in_bam)
    if utils.file_exists(in_bam + ".bai"):
        utils.remove_safe(in_bam + ".bai")
1204315
def remove_file(file_path):
    """"""
    if path.exists(file_path):
        try:
            rmtree(file_path)
        except Exception:
            print('Unable to remove temporary workdir {}'.format(file_path))
601447
def remove_file(self, path):
        """"""
        self.get_file(path).remove()
        self.remove_cache_buster(path)
559480
def remove(self, filename):
        
        files = self.get_value('list', [])
        files.remove(filename)
        self.set_value('list', files)
        self.updated.emit()
1277104
def rm_files(path, extension):
    
    files = list_files(extension, path)
    for file in files:
        if file.endswith(extension):
            os.remove(os.path.join(path, file))
    return
104573
def CleanUp(self, path):
    """"""
    try:
      if os.path.exists(path):
        os.remove(path)
    except (OSError, IOError) as e:
      logging.info("Failed to remove temporary file %s. Err: %s", path, e)
919791
def remove_unwanted_files
        file_array = []
        root_path = FileUtils.join_paths(@install_path, @project_name)
        unless @config_file[:remove_files].nil?
          @config_file[:remove_files].each do |file|
            file_array << FileUtils.join_paths(root_path, file)
          end
          FileUtils.remove_files(file_array)
        end
      end
763953
def remove_tar_files(file_list):
    """"""
    for f in file_list:
        if file_exists(f) and f.endswith('.tar'):
            os.remove(f)
235895
def remove(self):
        """"""
        import shutil
        printtime('Removing large and/or temporary files', self.start)
        removefolder = list()
        for sample in self.metadata:
            # Use os.walk to iterate through all the files in the sample output directory
            for path, dirs, files in os.walk(sample.general.outputdirectory):
                for item in files:
                    # Use regex to find files to remove
                    if re.search(".fastq$", item) or re.search(".fastq.gz$", item) or re.search(".bam$", item) \
                            or re.search(".bt2$", item) or re.search(".tab$", item) or re.search("^before", item) \
                            or re.search("^baitedtargets", item) or re.search("_combined.csv$", item) \
                            or re.search("^scaffolds", item) or re.search(".fastg$", item) or re.search(".gfa$", item) \
                            or re.search(".bai$", item) or 'coregenome' in path or 'prophages' in path:
                        # Keep the baitedtargets.fa, core genome, and merged metagenome files
                        if item != 'baitedtargets.fa' and not re.search("coregenome", item) \
                                and not re.search("paired", item):
                            # Remove the unnecessary files
                            try:
                                os.remove(os.path.join(path, item))
                            except IOError:
                                pass
        # Clear out the folders
        for folder in removefolder:
            try:
                shutil.rmtree(folder)
            except (OSError, TypeError):
                pass
923130
function _deleteTmpFiles(files, done) {
        var keys;
        if (files) {
          keys = Object.keys(files);
        }
        if (keys && keys.length) {
          fs.unlink(files[keys[0]].path, function(err) {
                delete files[keys[0]];
                if (err) {
                  done(err);
                }
                else {
                  _deleteTmpFiles(files, done);
                }
            });
        }
        else {
          done(null);
        }
      }