dbm
dbm
dbm?
dbm-open
dbm-close!
dbm-remove!
dbm-set!
dbm-ref
8.12

dbm🔗ℹ

Jay McCarthy <jay@racket-lang.org>

 (require file/dbm) package: dbm

This package provides an interface to UNIX dbm databases for Racket.

procedure

(dbm? v)  boolean?

  v : any/c
Returns #t if v is a dbm structure, #f otherwise.

A dbm structure is a dictionary.

procedure

(dbm-open pth)  dbm?

  pth : path-string?
Opens the dbm file at pth, returning a handle.

procedure

(dbm-close! dbm)  void

  dbm : dbm?
Closes the database handled by dbm.

procedure

(dbm-remove! dbm key)  void

  dbm : dbm?
  key : string?
Removes key from dbm.

procedure

(dbm-set! dbm key val [#:replace? replace?])  void

  dbm : dbm?
  key : string?
  val : string?
  replace? : boolean? = #f
Sets key to val in dbm. Results in an error if key is present in dbm and replace? is not true.

procedure

(dbm-ref dbm key fail)  string?

  dbm : dbm?
  key : string?
  fail : (or/c string? (-> string?))
Returns key’s value in dbm, calling or returning fail if key is not present, like dict-ref.