[HDF5] On every new file creation add NXroot attributes file_name and file_time
Requested by Jon Wright. Since we use generic names and the files can be moved around, traceability can be lost.
When creating a new HDF5 file (not when opening an existing one) one would need to add the full path of the file
write_h5_attribute(*new_file.m_file, "default", new_file.m_entry_name);
string nxroot = "NXroot";
write_h5_attribute(*new_file.m_file, "NX_class", nxroot);
string nxcreator = "LIMA-"+ m_ct_parameters.lima_version;
write_h5_attribute(*new_file.m_file, "creator", nxcreator);
---> string nxfile_name = FULL_PATH_TO_THE_FILE;
---> write_h5_attribute(*new_file.m_file, "file_name", nxfile_name);
and the time:
#ifdef WIN32
struct tm gmtime_now;
gmtime_s(&gmtime_now, &now);
strftime(buf, sizeof(buf), "%FT%TZ", &gmtime_now);
#else
strftime(buf, sizeof(buf), "%FT%TZ", gmtime(&now));
#endif
string nxfile_time = string(buf);
write_h5_attribute(*new_file.m_file, "file_time", nxfile_time);