4 ms·
- occasionally accidentally truncates the database If you're going to do this, at least write to a temporary file, fsync the file, rename into place, and fsync
by scottlamb 6y ago
- occasionally accidentally truncates the database
If you're going to do this, at least write to a temporary file, fsync the file, rename into place, and fsync the directory. But I recommend SQLite any time someone is tempted to write these lines.