()
| 291 | } |
| 292 | |
| 293 | func (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. |
no test coverage detected