writeBytesSync static method
Implementation
static void writeBytesSync(File target, List<int> bytes) {
target.parent.createSync(recursive: true);
final temporary = File(
'${target.path}.tmp-${pid}-${DateTime.now().microsecondsSinceEpoch}',
);
try {
temporary.writeAsBytesSync(bytes, flush: true);
temporary.renameSync(target.path);
} finally {
if (temporary.existsSync()) temporary.deleteSync();
}
}