How is Berkley gdbm typically used?

125 Views Asked by At

Gdbm is a simple key – value storage. I suspect that its use is based on various tricks. For example, from end-user perspective, I would like to have a record named user/project, that should have associated the following:

  • protocol, git:// or http://
  • domain like: github.com, bitbucket.com, etc. – forming url like github://user/project
  • enabled / disabled
  • method of loading – here 3 different methods like "native", "binary", "normal"
  • main file – "main.c", or other
  • ignore files – say "&" separated string with file paths to ignore
  • depth – number of commits to download

I think this is enough. What I mean is that real world uses are sophisticated and Gdbm doesn't seem to defend itself. Is there a way to apply its use for above scenario?

1

There are 1 best solutions below

0
On

Will this work? GDBM uses hashes, and if you use MLDBM you can store hashes of hashes as references.

%bobs_game_prj = { proto => git
  domain => blah.com
  ignore => \%ignore_files = { file1 => path, file2 => path}
  etc.}

I do something like this with perl, but I imagine it works in any programming language.