Beispiel #1
0
// Open a hash table file.
func OpenHash(name string, path []string) (ht *HashTable, err error) {
	file, err := commonfile.Open(name, HT_FILE_SIZE)
	if err != nil {
		return
	}
	ht = &HashTable{File: file, Path: path, Mutex: &sync.RWMutex{}}
	ht.calculateSizeInfo()
	return ht, nil
}
Beispiel #2
0
// Open a collection file.
func OpenCol(name string) (*ColFile, error) {
	file, err := commonfile.Open(name, COL_FILE_SIZE)
	return &ColFile{File: file}, err
}