File: dbmdump

package info (click to toggle)
epic5 3.0.3-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 5,328 kB
  • sloc: ansic: 75,810; makefile: 648; ruby: 227; python: 215; sh: 78; perl: 13
file content (18 lines) | stat: -rw-r--r-- 437 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#
# Here's the plan
#
# I need a script that dumps what's in an (n)dbm file, since there aren't a 
# lot of tools that support them any more.  Maybe I should be using some other 
# file format....
#
alias dbmdump (filename, ...) {
	@ :dbm = dbmctl(OPEN STD $filename);
	@ :key = dbmctl(NEXT_KEY $dbm 1);
	do
	{
		@ :value = dbmctl(READ $dbm $key);
		echo $filename - $key - $db = $value;
	}
	while ((key = dbmctl(NEXT_KEY $dbm 0)));
};