MCPcopy Create free account
hub / github.com/couchbase/moss / createNextFileLOCKED

Method createNextFileLOCKED

store.go:293–307  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

291}
292
293func (s *Store) createNextFileLOCKED() (string, File, error) {
294 // File to be opened in RDWR mode here because this is either
295 // invoked by the persister or the compactor either of which
296 // do not execute in the ReadOnly mode
297 fname := FormatFName(s.nextFNameSeq)
298 s.nextFNameSeq++
299
300 file, err := s.options.OpenFile(path.Join(s.dir, fname),
301 os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
302 if err != nil {
303 return "", nil, err
304 }
305
306 return fname, file, nil
307}
308
309// removeFileOnClose will setup the callback to wipe out the file safely
310// when all references to it are closed.

Callers 1

startFileLOCKEDMethod · 0.95

Calls 1

FormatFNameFunction · 0.85

Tested by

no test coverage detected