Skip to content

Commit 9b774cb

Browse files
pnwkwdavidrohr
authored andcommitted
Make separate directories for screenshots per month
1 parent 69f784c commit 9b774cb

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

EventVisualisation/View/src/Screenshot.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,15 @@ void Screenshot::perform(o2::detectors::DetID::mask_t detectorsMask, int runNumb
139139

140140
TASImage* scaledImage;
141141

142+
bool monthDirectory = settings.GetValue("screenshot.monthly", 0);
143+
144+
if (monthDirectory) {
145+
char dir_str[32];
146+
std::strftime(dir_str, sizeof(dir_str), "%Y-%d", std::localtime(&time));
147+
outDirectory = outDirectory + "/" + dir_str;
148+
std::filesystem::create_directory(outDirectory);
149+
}
150+
142151
std::ostringstream filepath;
143152
filepath << outDirectory << "/Screenshot_" << time_str << ".png";
144153

0 commit comments

Comments
 (0)