writeFileAtomicallySync function

void writeFileAtomicallySync(
  1. String path,
  2. String contents
)

The same, without waiting. For a caller already on a synchronous path.

Implementation

void writeFileAtomicallySync(String path, String contents) {
  final temporary = File('$path.new')..writeAsStringSync(contents, flush: true);
  temporary.renameSync(path);
}