func Open(fn string) (s *Store, err error) {
	s = &Store{}

	defer func() {
		if e := recover(); e != nil {
			s = nil
			err = e.(error)
		}
	}()

	if s.accessor, err = storage.OpenFile(fn, os.O_RDWR, 0666); err != nil {
		return nil, fmt.Errorf("%s: %s", me(), err)
	}

	b := make([]byte, 16)
	if n, err := s.accessor.ReadAt(b, 0); n != 16 || err != nil {
		return nil, fmt.Errorf("%s: %d, %s", me(), n, err)
	}

	var h header
	if err = h.rd(b); err != nil {
		return nil, fmt.Errorf("%s: %s", me(), err)
	}

	s.HashWidth, s.PtrBytes = int(h.hashWidth), int(h.ptrBytes)
	if s.Store, err = hdb.Open(&hdbAccessor{s.delta(), s.accessor}); err != nil {
		return nil, fmt.Errorf("%s: %s", me(), err)
	}

	return
}
// Open opens a Store in/from named file fn. If successful, methods on the
// returned Store can be used for data exchange.  The HashWidth and PtrBytes
// are read from the DB.  Open returns the Store and an error, if any.
Open opens a Store in/from named file fn. If successful, methods on the
returned Store can be used for data exchange.  The HashWidth and PtrBytes
are read from the DB.  Open returns the Store and an error, if any.
// Open opens a Store in / from named file fn . If successful methods on the // returned Store can be used for data exchange . The HashWidth and PtrBytes // are read from the DB . Open returns the Store and an error if any .
func Open(fn string) (s *Store, err error) {
	s = &Store{}
	defer func() {
		if e := recover(); e != nil {
			s = nil
			err = e.(error)
		}
	}()
	if s.accessor, err = storage.OpenFile(fn, os.O_RDWR, 0666); err != nil {
		return nil, fmt.Errorf("%s: %s", me(), err)
	}
	b := make([]byte, 16)
	if n, err := s.accessor.ReadAt(b, 0); n != 16 || err != nil {
		return nil, fmt.Errorf("%s: %d, %s", me(), n, err)
	}
	var h header
	if err = h.rd(b); err != nil {
		return nil, fmt.Errorf("%s: %s", me(), err)
	}
	s.HashWidth, s.PtrBytes = int(h.hashWidth), int(h.ptrBytes)
	if s.Store, err = hdb.Open(&hdbAccessor{s.delta(), s.accessor}); err != nil {
		return nil, fmt.Errorf("%s: %s", me(), err)
	}
	return
}
func Open ( fn string ) ( s * Store , err error ) { s = & Store { } defer func ( ) { if e := recover ( ) ; e != nil { s = nil err = e . ( error ) } } ( ) if s . accessor , err = storage . OpenFile ( fn , os . O_RDWR , 0666 ) ; err != nil { return nil , fmt . Errorf ( " " , me ( ) , err ) } b := make ( [ ] byte , 16 ) if n , err := s . accessor . ReadAt ( b , 0 ) ; n != 16 || err != nil { return nil , fmt . Errorf ( " " , me ( ) , n , err ) } var h header if err = h . rd ( b ) ; err != nil { return nil , fmt . Errorf ( " " , me ( ) , err ) } s . HashWidth , s . PtrBytes = int ( h . hashWidth ) , int ( h . ptrBytes ) if s . Store , err = hdb . Open ( & hdbAccessor { s . delta ( ) , s . accessor } ) ; err != nil { return nil , fmt . Errorf ( " " , me ( ) , err ) } return }
Open opens a Store in/from named file fn.
Open opens a Store in / from named file fn .