/*
(non-Javadoc)

@see com.emc.ecs.nfsclient.nfs.NfsFile#rmdir()
762224
public NfsRmdirResponse rmdir() throws IOException {
        NfsRmdirResponse response = getNfs().wrapped_sendRmdir(makeRmdirRequest());
        setFileHandle(null);
        return response;
    }
757733
def rmtree(directory: str) -> None:
    
    log.debug("Deleting directory {!r}", directory)
    shutil.rmtree(directory, onerror=shutil_rmtree_onerror)
677218
def rmdir(self, dir_name):
        """"""
        self.check_write(dir_name)
        path = normpath_url(join_url(self.cur_dir, dir_name))
        # write("REMOVE %r" % path)
        shutil.rmtree(path)
138499
private function rrmdir($dir)
    {
        // protect from something bad happening
        if (0 !== strpos($dir, $this->storagePath)) {
            return false;
        }

        foreach (glob($dir . DIRECTORY_SEPARATOR . '*') as $file) {
            if (is_dir($file)) {
                $this->rrmdir($file);
            } else {
                unlink($file);
            }
        }

        return rmdir($dir);
    }
209929
public function rmdir($uri, $options)
    {
        $this->uri = $uri;

        return $this->invoke($this->getFilesystem(), 'rmdir', [$this->getTarget(), $options]);
    }
415615
public Nfs3RmdirResponse sendRmdir(NfsRmdirRequest request) throws IOException {
        Nfs3RmdirResponse response = new Nfs3RmdirResponse();
        _rpcWrapper.callRpcNaked(request, response);
        return response;
    }
508659
def rrmdir(directory):
    
    for root, dirs, files in os.walk(directory, topdown=False):
        for name in files:
            os.remove(os.path.join(root, name))
        for name in dirs:
            os.rmdir(os.path.join(root, name))
    os.rmdir(directory)
157266
private void createRepositoryDirectoryStructure(File rootDir) {
		this.objs = new File(rootDir, OBJECT_DIR);
		if (!objs.exists()) {
			if (!objs.mkdirs()) {
				throw new RuntimeException("Could not create dir: " + objs.getAbsolutePath());
			}
		}

		this.refs = new File(rootDir, REFERENCE_DIR);
		if (!refs.exists()) {
			if (!refs.mkdirs()) {
				throw new RuntimeException("Could not create dir: " + refs.getAbsolutePath());
			}
		}
	}
782291
public function deleteFiles($folder, $rmdir = false)
    {
        array_map('unlink', glob($folder . DS . '*'));
        if ($rmdir) {
            rmdir($folder);
        }
    }
967677
def rm_rf(path):
    
    if os.path.isfile(path):
        os.unlink(path)
    elif os.path.isdir(path):
        for root, dirs, files in os.walk(path, topdown=False):
            for filename in files:
                filepath = os.path.join(root, filename)
                logger.info("Deleting file %s" % filepath)
                os.unlink(filepath)
            for dirname in dirs:
                dirpath = os.path.join(root, dirname)
                if os.path.islink(dirpath):
                    logger.info("Deleting link %s" % dirpath)
                    os.unlink(dirpath)
                else:
                    logger.info("Deleting dir %s" % dirpath)
                    os.rmdir(dirpath)
        logger.info("Deleting dir %s", path)
        os.rmdir(path)
593919
public function rmdir($dir) {
		$this->connectIfNeeded();
		$this->handle->rmdir($dir);
		$this->onFolderDeleted(new Event(['sender' => $this, 'data' => $dir]));
	}
470409
def rmdir(self, pathobj):
        
        stat = self.stat(pathobj)

        if not stat.is_dir:
            raise OSError(20, "Not a directory: '%s'" % str(pathobj))

        url = str(pathobj) + '/'

        text, code = self.rest_del(url, session=pathobj.session, verify=pathobj.verify, cert=pathobj.cert)

        if code not in [200, 202, 204]:
            raise RuntimeError("Failed to delete directory: '%s'" % text)
614883
def rmdir(store, path=None):
    """"""
    path = normalize_storage_path(path)
    if hasattr(store, 'rmdir'):
        # pass through
        store.rmdir(path)
    else:
        # slow version, delete one key at a time
        _rmdir_from_keys(store, path)
16707
private function _rrmdir($dir)
    {
        if ($handle = opendir($dir)) {
            while (false !== ($file = readdir($handle))) {
                if ($file != '.' && $file != '..') {
                    if (is_dir($dir . '/' . $file)) {
                        $this->_rrmdir($dir . '/' . $file);
                        rmdir($dir . '/' . $file);
                    } else {
                        unlink($dir . '/' . $file);
                    }
                }
            }
            closedir($handle);
        }
    }
204907
public void setSrcdir(Path srcDir) {
        if (src == null) {
            src = srcDir;
        } else {
            src.append(srcDir);
        }
    }
266290
def rm_rf(path):
    
    if os.path.isdir(path) and not os.path.islink(path):
        shutil.rmtree(path)
    elif os.path.lexists(path):
        os.remove(path)
740914
function rm(src) {
      if (fs.existsSync(src)) {
        var stat = fs.statSync(src);
        if (stat.isFile()) {
          fs.unlinkSync(src);
        }
        else if (stat.isDirectory()) {
          var subSrcs = fs.readdirSync(src);
          subSrcs.forEach(function (file) {
            var subSrc = path.join(src, file);
            rm(subSrc);
          });
          try {
            fs.rmdirSync(src);
          } catch (e) {
            setTimeout(function () {
              if (/win/.test(process.platform)) {
                var absSrc = path.resolve(src);
                execSync('rd /s /q ' + absSrc);
              } else {
                execSync('rm -rf ' + src);
              }
            }, 500);
          }
        }
      }
    }