Contents

2008-03-31: outdated
4.5. File structure
This section details how a database described in section Database is saved on a file system (e.g. disks, usb flash cards, ...). The database is saved a defined directory containing three kinds of basic files: ".sdb", ".group", and ".grouplist". Other files are also saved in this directory: modified signals (see ISORIGINALFILE) and temporary swap files.
In the following, the database name is supposed to be "db". Hence the directory containing the database is "db/" and the ".sdb" file is "db/db.sdb".
".sdb" file
This is a text file containing one value per line, with the following syntax.
Syntax of lines for the ".sdb" file |
KEYWORD=VALUE |
KEYWORD is case sensitive and it cannot contain any '=' sign. Blanks are not accepted before the KEYWORD and around the '=' sign. The VALUE on the right can contain any characters including blanks.
The order of KEYWORDs is strict. The first line of the file is the version of the format. Currently, version is 2. The file contains a list of signals grouped by file. The general structure is:
General structure of ".sdb" file |
version 2 FILE=/absolute/file/path/and/file/name/of/first/signal/file FORMAT=7 ISORIGINALFILE=1 ID=1 ... specific information about first signal ID=2 ... specific information about second signal ... ID=n ... specific information about signal n FILE=/absolute/file/path/and/file/name/of/second/signal/file FORMAT=8 ISORIGINALFILE=1 ID=n+1 ... specific information about first signal ID=n+2 ... specific information about second signal ... |
The information about each signal contains the following keywords (the order is strict):
Information about each signal |
ID=1 NAME=R01A COMPONENT=0 T0=0 TIME REF=01/01/2003 00:00:00 DELTA T=0.00875 TYPE=0 PICK 1=102.688 PICK 2=298.102 PICK 3=0 PICK 4=0 PICK 5=0 PICK 6=0 PICK 7=0 PICK 8=0 PICK 9=0 PICK 10=0 PICK ID 1=1 PICK ID 2=0 PICK ID 3=0 PICK ID 4=0 PICK ID 5=0 PICK ID 6=0 PICK ID 7=0 PICK ID 8=0 PICK ID 9=0 PICK ID 10=0 RECEIVER=1988 2002 0 SOURCE=0 0 0 |
The number of signals in each file specified in "db.sdb" must be equal to the real number of signals stored in the signal file. On opening a database, the signal files are not checked. Though a database may be created outside geopsy, this method is not advised and may lead to unstable behaviours. However, the original files are never modified and the ".sdb" is written only when choosing "Save database" from menu "File", hence there is absolutely no risk to corrupt the original information.
".grouplist" file
There is only one ".grouplist" file per database. It contains the list of groups referenced by their names. Each characters is coded on 16 bits which forbid its modification with any text editor. Under Linux, you can visualise this file with bvi or with kwrite (set encoding to UTF16). The binary format depends upon the export format of QStringList. The first 32 bits is the number of groups. Then, each name is stored with a first 32 bits for the string length and the characters coded on 16 bits.
".group" files
This is a binary file that contains the list signal IDs belonging to the group. The format is very simple: a list of integers (32 bits). The base name of these files is the group's name. Under Linux, you can visualise this file with bvi.
".sig" files
When geopsy is running low on memory space, it may be forced to swap signal vectors to the disk. If the current user have sufficient permissions in the database directory, temporary files are written in this directory. When no instance of geopsy is running, none of these files must exist. In case of crash, it may be possible that some of these file were not correctly cleared. You can remove all of them without any consequences assuming that no database is currently running.
"_n" files
When saving a database, the modified signals are automatically saved to the database directory. These files have the same names as their original files with a suffix "_n", n being a unique number. Do not remove these files manually. You can remove these files by removing their entries in the database.