Open a {@link RocksDB} with default options in read-only mode.

@param dirPath
existing {@link RocksDB} data directory
@return
@throws RocksDbException
@throws IOException
485051
public static RocksDbWrapper openReadOnly(String dirPath) throws RocksDbException, IOException {
        RocksDbWrapper rocksDbWrapper = new RocksDbWrapper(dirPath, true);
        rocksDbWrapper.init();
        return rocksDbWrapper;
    }
1298916
public function createDirectory($dirPath)
    {
      if (! $this->fs->exists($dirPath))
      {
        $this->fs->mkdir($dirPath);
      }
    }
718775
def open(self, file_path):
        

        from simplesqlite import SimpleSQLite

        if self.is_opened():
            if self.stream.database_path == abspath(file_path):
                self._logger.logger.debug(
                    "database already opened: {}".format(self.stream.database_path)
                )
                return

            self.close()

        self._stream = SimpleSQLite(file_path, "w")
828888
private void createLibFolder() throws IOException {
        if(!Files.exists(libLocation.toPath()))
            Files.createDirectories(libLocation.toPath());
    }
454151
function _openPath(treeData, path) {
        var objectPath = _filePathToObjectPath(treeData, path);

        function setOpen(node) {
            return node.set("open", true);
        }

        while (objectPath && objectPath.length) {
            var node = treeData.getIn(objectPath);
            if (isFile(node)) {
                objectPath.pop();
            } else {
                if (!node.get("open")) {
                    treeData = treeData.updateIn(objectPath, setOpen);
                }
                objectPath.pop();
                if (objectPath.length) {
                    objectPath.pop();
                }
            }
        }

        return treeData;
    }
591781
def AddDir(self, dirpath):
    
    if dirpath not in self._dirs:
      self._dirs.add(dirpath)
      return True
    return False
231196
@Override
	@SuppressWarnings("unchecked")
	public boolean delDir(String dirPath) {
		if (false == cd(dirPath)) {
			return false;
		}

		Vector<LsEntry> list = null;
		try {
			list = channel.ls(channel.pwd());
		} catch (SftpException e) {
			throw new JschRuntimeException(e);
		}

		String fileName;
		for (LsEntry entry : list) {
			fileName = entry.getFilename();
			if (false == fileName.equals(".") && false == fileName.equals("..")) {
				if (entry.getAttrs().isDir()) {
					delDir(fileName);
				} else {
					delFile(fileName);
				}
			}
		}

		if (false == cd("..")) {
			return false;
		}

		// 删除空目录
		try {
			channel.rmdir(dirPath);
			return true;
		} catch (SftpException e) {
			throw new JschRuntimeException(e);
		}
	}
804113
public Directory createDirectory(JimfsPath path, FileAttribute<?>... attrs) throws IOException {
    return (Directory) createFile(path, store.directoryCreator(), true, attrs);
  }
989363
public DirRecord newRecord(String entryDn) throws NamingException {
    DirRecord rec = new BasicDirRecord();
    rec.setDn(entryDn);
    return rec;
  }
473868
def open_shapefile(shapefile_path, file_geodatabase=None):
    
    if file_geodatabase:
        gdb_driver = ogr.GetDriverByName("OpenFileGDB")
        ogr_shapefile = gdb_driver.Open(file_geodatabase)
        ogr_shapefile_lyr = ogr_shapefile.GetLayer(shapefile_path)
    else:
        ogr_shapefile = ogr.Open(shapefile_path)
        ogr_shapefile_lyr = ogr_shapefile.GetLayer()
    return ogr_shapefile_lyr, ogr_shapefile
929135
private static void loadFile(String filePath) {
        final Path path = FileSystems.getDefault().getPath(filePath);

        try {
            data.clear();
            data.load(Files.newBufferedReader(path));
        } catch(IOException e) {
            LOG.warn("Exception while loading " + path.toString(), e);
        }
    }
822120
public InProcessVoltDBServer runDDLFromPath(String path) {
        int ret = SQLCommand.mainWithReturnCode(new String[] { String.format("--ddl-file=%s", path) });
        assert(ret == 0);
        return this;
    }
473785
public static AndroidSQLCipherSQLite open(File path, KeyProvider provider) {

        //Call SQLCipher-based method for opening database, or creating if database not found
        SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(path,
                KeyUtils.sqlCipherKeyForKeyProvider(provider), null);

        return new AndroidSQLCipherSQLite(db);
    }
64556
def mkdir_interactive(dirpath):
    
    from benchbuild.utils.cmd import mkdir
    if os.path.exists(dirpath):
        return

    response = ui.ask(
        "The directory {dirname} does not exist yet. "
        "Should I create it?".format(dirname=dirpath),
        default_answer=True,
        default_answer_str="yes")

    if response:
        mkdir("-p", dirpath)
        print("Created directory {0}.".format(dirpath))
596581
static function giveDefaultLocksDir($dirPath)
    {
        if ( isset(static::$defLockDirectory) )
            throw new exImmutable(sprintf(
                'Default Lock Directory Has Value: (%s).'
                , static::$defLockDirectory
            ));


        $dirPath = (string) $dirPath;
        if (! (is_dir($dirPath) && is_writable($dirPath))  )
            throw new \RuntimeException(sprintf(
                'Lock Folder (%s) Is Not A Writable Directory Or Not Exists.'
                , $dirPath
            ));


        static::$defLockDirectory = $dirPath;
    }
1052042
void createDirectory(Path path) throws IOException {
		if (Files.exists(path) && Files.isDirectory(path)) {
			return;
		}

		if (this.readOnly) {
			throw new FileNotFoundException(
					"The requested directory \""
							+ path.toString()
							+ "\" does not exist and we are in read-only mode, so it cannot be created.");
		}

		Files.createDirectory(path);
	}
255914
public void setDirectoryPath(String pidsfilepath) {
        File pidsfile = new File(pidsfilepath);
        directoryPath = pidsfile.getParent();
    }