writeFile method
Write a CLDF archive to a file
Implementation
Future<void> writeFile(String filePath, CLDFArchive archive) async {
_logger.info('Starting CLDF export to file: $filePath');
try {
final bytes = await writeBytes(archive);
final file = File(filePath);
_logger.fine('Writing ${bytes.length} bytes to $filePath');
await file.writeAsBytes(bytes);
_logger.info('Export completed successfully to $filePath');
} catch (e, stackTrace) {
_logger.severe('Export failed: Error writing file', e, stackTrace);
rethrow;
}
}