mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-22 03:04:35 +02:00
Add code to generate LATEST pointer
This commit is contained in:
@@ -16,7 +16,19 @@ BinaryWriter::BinaryWriter(
|
||||
current_filename_(""),
|
||||
output_fd_(-1)
|
||||
{
|
||||
latest_filename_ = root_folder + "/" + device_name + "/LATEST";
|
||||
|
||||
#ifdef DEBUG_OUTPUT
|
||||
using namespace date;
|
||||
using namespace chrono;
|
||||
cout << "[" << system_clock::now() << "]";
|
||||
cout << "[BinaryWriter::BinaryWriter]";
|
||||
cout << " Starting with";
|
||||
cout << " device_name " << device_name_;
|
||||
cout << " root_folder_ " << root_folder_;
|
||||
cout << " latest_filename_ " << latest_filename_;
|
||||
cout << endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
void BinaryWriter::write(uint64_t pulse_id, const JFFileFormat& buffer)
|
||||
@@ -40,5 +52,13 @@ void BinaryWriter::close_current_file()
|
||||
|
||||
throw runtime_error(err_msg.str());
|
||||
}
|
||||
|
||||
// TODO: Ugly hack, please please fix it.
|
||||
stringstream latest_command;
|
||||
latest_command << "echo " << current_filename_;
|
||||
latest_command << " > " << latest_filename_;
|
||||
auto str_latest_command = latest_command.str();
|
||||
|
||||
system(str_latest_command.c_str());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user