Remove this file or link.
        If the path is a directory, use rmdir() instead.
19094
def unlink(self):
        
        if self._closed:
            self._raise_closed()
        self._accessor.unlink(self)
562362
def rm(filename, recursive=False, force=False):
    """"""
    return auto(remove_file, filename, recursive, force)
1054195
def rmfile(path):
    """"""
    if osp.isfile(path):
        if is_win:
            os.chmod(path, 0o777)
        os.remove(path)
1109922
def rm(path):
    
    if path and os.path.exists(path):
        if os.path.isdir(path):
            shutil.rmtree(path)
        else:
            os.remove(path)
74223
def delete(self):
        
        if os.path.isfile(self.path):
            os.remove(self.path)
        else:
            shutil.rmtree(self.path)
1041653
def delete_symlink(path)
      if Origen.running_on_windows?
        # Don't use regular rm on windows symlink, will delete into the remote dir!
        system("call cmd /c rmdir #{path.to_s.gsub('/', '\\')}")
        FileUtils.rm_f("#{path}_is_a_symlink")
      else
        FileUtils.rm_f(path)
      end
    end
1065931
def remove(self):
        

        directory = self._directory()
        assert isinstance(directory, Directory)
        directory._fileDeleted(self)
192837
def remove_file(filename, path=None):
    
    cwd = os.getcwd()
    try:
        if path:
            os.chdir(path)
    except OSError:
        raise
    try:
        os.remove(filename)
        os.chdir(cwd)
        return True
    except OSError:
        os.chdir(cwd)
        raise
828292
function removeDir(dirPath, cleanOnly) {
  var files;

  try {
    files = fs.readdirSync(dirPath);
  } catch(e) {
    return;
  }

  if (files.length > 0) {
    for (var i = 0; i < files.length; i++) {
      var filePath = path.join(dirPath, files[i]);
      if (fs.statSync(filePath).isFile())
        fs.unlinkSync(filePath);
      else
        rmDir(filePath);
    }
  }

  !cleanOnly && fs.rmdirSync(dirPath);
}
984066
def symlink_remove(link):
    
    # https://stackoverflow.com/q/26554135/6400719
    if os.path.isdir(path2str(link)) and is_windows:
        # this should only be on Py2.7 and windows
        os.rmdir(path2str(link))
    else:
        os.unlink(path2str(link))
1133602
def remove(path):
    '''
    
    '''
    try:
        os.remove(path)
    except OSError as exc:
        if exc.errno != errno.ENOENT:
            raise
1333097
def clear_dir(path):
    """"""
    for f in os.listdir(path):
        f_path = os.path.join(path, f)
        if os.path.isfile(f_path) or os.path.islink(f_path):
            os.unlink(f_path)
513854
function remove(path) {
	let files = [];
	if( fs.existsSync(path) ) {
		if(fs.statSync(path).isFile()){
			fs.unlinkSync(path);
			return;
		}

		files = fs.readdirSync(path);
		files.forEach(function(file, index){
			let curPath = path + "/" + file;
			if(fs.statSync(curPath).isDirectory()) {
				remove(curPath)
			} else {
				fs.unlinkSync(curPath);
			}
		});
		fs.rmdirSync(path, err=>console.error(err));
	}
}
1228608
def remove_files(root_dir):
    
    for dirpath, dirnames, filenames in os.walk(os.path.abspath(root_dir)):
        for filename in filenames:
            os.remove(os.path.join(root_dir, filename))

        for dirname in dirnames:
            shutil.rmtree(os.path.join(root_dir, dirname))
641007
function cleanFolder(outPath) {
    try {
        var stat = fs.lstatSync(outPath);
        if (stat.isDirectory()) {
            wrench.rmdirSyncRecursive(outPath);
        } else  {
            fs.unlinkSync(outPath);
        }
    } catch (e) {
        if (e.code != "ENOENT") throw e;
    }
}
959822
def remove_tree(self, dirname):
        """"""
        while osp.exists(dirname):
            try:
                shutil.rmtree(dirname, onerror=misc.onerror)
            except Exception as e:
                # This handles a Windows problem with shutil.rmtree.
                # See issue #8567.
                if type(e).__name__ == "OSError":
                    error_path = to_text_string(e.filename)
                    shutil.rmtree(error_path, ignore_errors=True)
1063054
def clear_dir(self):
        """"""
        self.stdout.write("Deleting contents of '{}'.".format(self.destination_path))

        for filename in os.listdir(self.destination_path):
            if os.path.isfile(filename) or os.path.islink(filename):
                os.remove(filename)
            elif os.path.isdir(filename):
                shutil.rmtree(filename)