Skip to documentation
DocumentationAll documentsEnglish

OPENDB(nged)

NAME

opendb - Open a BRL-CAD database and make it current.

On this page

SYNOPSIS

opendb
opendb [-c] [-f] [-h] [-o] filename
opendb [--create] [--flip-endian] [--help] [--open] filename

DESCRIPTION

With no filename argument, opendb reports the currently open database path. If no database is open, it reports that state instead.

When a filename is supplied, opendb closes any currently open database and opens the requested database file.

By default, opendb is willing to create a new database if the requested file does not already exist. Use -o or --open to require that the file already exist.

If -f or --flip-endian is supplied and the target file is a v4 database, the file is treated as a binary-incompatible database and opened with flipped endianness. This is useful for legacy v4 databases created on incompatible platforms. When such flipping is applied, the database is made read-only.

OPTIONS

-c, --create

Allow creation of a new database if filename does not already exist. This is the default behavior and overrides -o.

-f, --flip-endian

Treat a v4 database as a binary-incompatible file and flip its endianness on open. Ignored for non-v4 databases.

-h, --help

Print command help.

-o, --open

Require that filename already exist and open only that file.

EXAMPLES

Example 1. Open an existing database.

mged> opendb -o model.g

Closes the current database, if any, and opens the existing model.g file.

Example 2. Report the currently open database path.

mged> opendb

Returns the name of the current database file.

Example 3. Open a legacy v4 database with forced endian flipping.

mged> opendb -f legacy_v4.g

Opens legacy_v4.g as a binary-incompatible v4 database. If flipping is applied, the database is opened read-only.

SEE ALSO

open(nged), closedb(nged), reopen(nged), dbupgrade(nged)

AUTHOR

BRL-CAD Team

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org