filename property
Full path and filename of the current file, on the format
~/carp/deployments/<study_deployment_id>/data/carp-data-yyyy-mm-dd-hh-mm-ss-ms.json
where the date is the creation time in UTC (zulu time). A new name is generated each time a file is flushed.
Implementation
Future<String> get filename async {
if (_filename == null) {
final created = DateTime.now()
.toUtc()
.toString()
.replaceAll(RegExp(r':'), '-')
.replaceAll(RegExp(r' '), '-')
.replaceAll(RegExp(r'\.'), '-');
await path;
_filename = '$_path/carp-data-$created.json';
}
return _filename!;
}