{"action":"created","comment":{"url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/pulls/comments/194347009","pull_request_review_id":127498948,"id":194347009,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDM0NzAwOQ==","diff_hunk":"@@ -41,115 +41,97 @@ namespace dqm4hep {\n \n   namespace core {\n \n-    Archiver::Archiver(const std::string &archiveFileName, const std::string &openingMode, bool allowSuffix) {\n-      THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->open(archiveFileName, openingMode, allowSuffix));\n+    Archiver::Archiver(const std::string &archiveFileName, const std::string &opMode, bool overwrite) {\n+      THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->open(archiveFileName, opMode, overwrite));\n     }\n \n     //-------------------------------------------------------------------------------------------------\n \n     Archiver::~Archiver() {\n-      if (m_isOpened)\n+      if (isOpened())\n         close();\n     }\n \n     //-------------------------------------------------------------------------------------------------\n \n-    StatusCode Archiver::open(const std::string &archiveFileName, const std::string &openingMode, bool allowSuffix) {\n+    StatusCode Archiver::open(const std::string &fname, const std::string &opMode, bool overwrite) {\n       // if already open write the archive if not done\n       // and close it before to re-open\n-      if (m_isOpened)\n+      if (isOpened()) {\n         RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, close());\n-\n-      if (archiveFileName.empty())\n+      }\n+      if (fname.empty()) {\n         return STATUS_CODE_INVALID_PARAMETER;\n-\n-      if (allowSuffix) {\n+      }\n+      if (not overwrite) {\n         int fileId(0);\n-\n-        size_t pos = archiveFileName.rfind(\".root\");\n-\n+        size_t pos = fname.rfind(\".root\");\n         if (std::string::npos == pos) {\n-          dqm_error(\"Couldn't open archive '{0}' ! Must be a root file !\", archiveFileName);\n+          dqm_error(\"Couldn't open archive '{0}' ! Must be a root file !\", fname);\n           return STATUS_CODE_INVALID_PARAMETER;\n         }\n-\n-        std::string baseArchiveName = archiveFileName.substr(0, pos);\n-        std::string fullArchiveName = archiveFileName;\n-\n+        std::string baseArchiveName = fname.substr(0, pos);\n+        std::string fullArchiveName = fname; \n         while (!gSystem->AccessPathName(fullArchiveName.c_str())) {\n           std::stringstream ss;\n           ss << baseArchiveName << \"_\" << fileId << \".root\";\n           fullArchiveName = ss.str();\n           fileId++;\n         }\n-\n         m_fileName = fullArchiveName;\n-      } else {\n-        m_fileName = archiveFileName;\n+      } \n+      else {\n+        m_fileName = fname;\n       }\n-\n-      m_openingMode = openingMode;\n-\n+      m_openingMode = opMode;\n       dqm_info(\"Archiver::open: Opening archive {0}\", m_fileName);\n-\n-      m_pArchiveFile = new TFile(m_fileName.c_str(), openingMode.c_str());\n-\n-      if (nullptr == m_pArchiveFile) {\n-        dqm_error(\"Couldn't open archive '{0}' !\", m_fileName);\n+      m_file.reset(new TFile(m_fileName.c_str(), m_openingMode.c_str()));\n+      if (nullptr == m_file) {\n+        dqm_error(\"Archiver::open: Couldn't open archive '{0}' !\", m_fileName);\n         return STATUS_CODE_FAILURE;\n       }\n-\n       m_isOpened = true;\n-\n       return STATUS_CODE_SUCCESS;\n     }\n \n     //-------------------------------------------------------------------------------------------------\n \n     StatusCode Archiver::close() {\n-      if (!m_isOpened)\n-        return STATUS_CODE_FAILURE;\n-\n-      m_pArchiveFile->Close();\n-      delete m_pArchiveFile;\n-\n-      m_pArchiveFile = nullptr;\n-\n+      if (not isOpened()) {\n+        return STATUS_CODE_SUCCESS;","path":"source/src/Archiver.cc","position":99,"original_position":99,"commit_id":"74648743c0b93974a1b6e7e5941e7005453e5954","original_commit_id":"74648743c0b93974a1b6e7e5941e7005453e5954","user":{"login":"apingault","id":11057316,"node_id":"MDQ6VXNlcjExMDU3MzE2","avatar_url":"https://avatars1.githubusercontent.com/u/11057316?v=4","gravatar_id":"","url":"https://api.github.com/users/apingault","html_url":"https://github.com/apingault","followers_url":"https://api.github.com/users/apingault/followers","following_url":"https://api.github.com/users/apingault/following{/other_user}","gists_url":"https://api.github.com/users/apingault/gists{/gist_id}","starred_url":"https://api.github.com/users/apingault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apingault/subscriptions","organizations_url":"https://api.github.com/users/apingault/orgs","repos_url":"https://api.github.com/users/apingault/repos","events_url":"https://api.github.com/users/apingault/events{/privacy}","received_events_url":"https://api.github.com/users/apingault/received_events","type":"User","site_admin":false},"body":"Shouldn't this not be allowed? Trying to close an already closed file might be a sign of a deeper problem somewhere. \r\nI would suggest to at least output a debug (even a Warning) message. ","created_at":"2018-06-11T09:46:14Z","updated_at":"2018-06-11T09:46:14Z","html_url":"https://github.com/DQM4HEP/dqm4hep-core/pull/62#discussion_r194347009","pull_request_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/pulls/62","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/pulls/comments/194347009"},"html":{"href":"https://github.com/DQM4HEP/dqm4hep-core/pull/62#discussion_r194347009"},"pull_request":{"href":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/pulls/62","id":193530990,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNTMwOTkw","html_url":"https://github.com/DQM4HEP/dqm4hep-core/pull/62","diff_url":"https://github.com/DQM4HEP/dqm4hep-core/pull/62.diff","patch_url":"https://github.com/DQM4HEP/dqm4hep-core/pull/62.patch","issue_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/issues/62","number":62,"state":"closed","locked":false,"title":"Archiver is back","user":{"login":"rete","id":950347,"node_id":"MDQ6VXNlcjk1MDM0Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/950347?v=4","gravatar_id":"","url":"https://api.github.com/users/rete","html_url":"https://github.com/rete","followers_url":"https://api.github.com/users/rete/followers","following_url":"https://api.github.com/users/rete/following{/other_user}","gists_url":"https://api.github.com/users/rete/gists{/gist_id}","starred_url":"https://api.github.com/users/rete/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rete/subscriptions","organizations_url":"https://api.github.com/users/rete/orgs","repos_url":"https://api.github.com/users/rete/repos","events_url":"https://api.github.com/users/rete/events{/privacy}","received_events_url":"https://api.github.com/users/rete/received_events","type":"User","site_admin":false},"body":"BEGINRELEASENOTES\r\n- Archiver class\r\n   - Added proper Doxygen documentation\r\n   - Added possiblity to archive references along with monitor objects by adding a suffix (default is \"_ref\")\r\n- MonitorElementManager class\r\n   - Added method `archive()` to archive current storage content with references\r\n- QTest runner\r\n   - Added `--root-output` or `-o` argument to allow for archiving monitor elements and references in a root file after processing\r\n   - Modified argument name for qreport output file to `--qreport-output` or `-q` \r\n- Set theme style to `polar` in test_samples.xml \r\n\r\nENDRELEASENOTES","created_at":"2018-06-08T07:32:01Z","updated_at":"2018-06-11T09:46:14Z","closed_at":"2018-06-08T07:55:28Z","merged_at":"2018-06-08T07:55:28Z","merge_commit_sha":"79c96963bde594ed77b478f15f916745ebb59d0e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/pulls/62/commits","review_comments_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/pulls/62/comments","review_comment_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/issues/62/comments","statuses_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/statuses/74648743c0b93974a1b6e7e5941e7005453e5954","head":{"label":"rete:archiver","ref":"archiver","sha":"74648743c0b93974a1b6e7e5941e7005453e5954","user":{"login":"rete","id":950347,"node_id":"MDQ6VXNlcjk1MDM0Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/950347?v=4","gravatar_id":"","url":"https://api.github.com/users/rete","html_url":"https://github.com/rete","followers_url":"https://api.github.com/users/rete/followers","following_url":"https://api.github.com/users/rete/following{/other_user}","gists_url":"https://api.github.com/users/rete/gists{/gist_id}","starred_url":"https://api.github.com/users/rete/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rete/subscriptions","organizations_url":"https://api.github.com/users/rete/orgs","repos_url":"https://api.github.com/users/rete/repos","events_url":"https://api.github.com/users/rete/events{/privacy}","received_events_url":"https://api.github.com/users/rete/received_events","type":"User","site_admin":false},"repo":{"id":108755855,"node_id":"MDEwOlJlcG9zaXRvcnkxMDg3NTU4NTU=","name":"dqm4hep-core","full_name":"rete/dqm4hep-core","owner":{"login":"rete","id":950347,"node_id":"MDQ6VXNlcjk1MDM0Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/950347?v=4","gravatar_id":"","url":"https://api.github.com/users/rete","html_url":"https://github.com/rete","followers_url":"https://api.github.com/users/rete/followers","following_url":"https://api.github.com/users/rete/following{/other_user}","gists_url":"https://api.github.com/users/rete/gists{/gist_id}","starred_url":"https://api.github.com/users/rete/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rete/subscriptions","organizations_url":"https://api.github.com/users/rete/orgs","repos_url":"https://api.github.com/users/rete/repos","events_url":"https://api.github.com/users/rete/events{/privacy}","received_events_url":"https://api.github.com/users/rete/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rete/dqm4hep-core","description":"DQM4HEP core implementation ","fork":true,"url":"https://api.github.com/repos/rete/dqm4hep-core","forks_url":"https://api.github.com/repos/rete/dqm4hep-core/forks","keys_url":"https://api.github.com/repos/rete/dqm4hep-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rete/dqm4hep-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rete/dqm4hep-core/teams","hooks_url":"https://api.github.com/repos/rete/dqm4hep-core/hooks","issue_events_url":"https://api.github.com/repos/rete/dqm4hep-core/issues/events{/number}","events_url":"https://api.github.com/repos/rete/dqm4hep-core/events","assignees_url":"https://api.github.com/repos/rete/dqm4hep-core/assignees{/user}","branches_url":"https://api.github.com/repos/rete/dqm4hep-core/branches{/branch}","tags_url":"https://api.github.com/repos/rete/dqm4hep-core/tags","blobs_url":"https://api.github.com/repos/rete/dqm4hep-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rete/dqm4hep-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rete/dqm4hep-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/rete/dqm4hep-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rete/dqm4hep-core/statuses/{sha}","languages_url":"https://api.github.com/repos/rete/dqm4hep-core/languages","stargazers_url":"https://api.github.com/repos/rete/dqm4hep-core/stargazers","contributors_url":"https://api.github.com/repos/rete/dqm4hep-core/contributors","subscribers_url":"https://api.github.com/repos/rete/dqm4hep-core/subscribers","subscription_url":"https://api.github.com/repos/rete/dqm4hep-core/subscription","commits_url":"https://api.github.com/repos/rete/dqm4hep-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/rete/dqm4hep-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/rete/dqm4hep-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/rete/dqm4hep-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/rete/dqm4hep-core/contents/{+path}","compare_url":"https://api.github.com/repos/rete/dqm4hep-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rete/dqm4hep-core/merges","archive_url":"https://api.github.com/repos/rete/dqm4hep-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rete/dqm4hep-core/downloads","issues_url":"https://api.github.com/repos/rete/dqm4hep-core/issues{/number}","pulls_url":"https://api.github.com/repos/rete/dqm4hep-core/pulls{/number}","milestones_url":"https://api.github.com/repos/rete/dqm4hep-core/milestones{/number}","notifications_url":"https://api.github.com/repos/rete/dqm4hep-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rete/dqm4hep-core/labels{/name}","releases_url":"https://api.github.com/repos/rete/dqm4hep-core/releases{/id}","deployments_url":"https://api.github.com/repos/rete/dqm4hep-core/deployments","created_at":"2017-10-29T17:34:47Z","updated_at":"2018-05-04T22:18:31Z","pushed_at":"2018-06-10T22:36:40Z","git_url":"git://github.com/rete/dqm4hep-core.git","ssh_url":"git@github.com:rete/dqm4hep-core.git","clone_url":"https://github.com/rete/dqm4hep-core.git","svn_url":"https://github.com/rete/dqm4hep-core","homepage":"","size":2104,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"DQM4HEP:master","ref":"master","sha":"3502ea0e2e53a387164fb9b37c4027b9c02b7dcc","user":{"login":"DQM4HEP","id":16612352,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NjEyMzUy","avatar_url":"https://avatars3.githubusercontent.com/u/16612352?v=4","gravatar_id":"","url":"https://api.github.com/users/DQM4HEP","html_url":"https://github.com/DQM4HEP","followers_url":"https://api.github.com/users/DQM4HEP/followers","following_url":"https://api.github.com/users/DQM4HEP/following{/other_user}","gists_url":"https://api.github.com/users/DQM4HEP/gists{/gist_id}","starred_url":"https://api.github.com/users/DQM4HEP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DQM4HEP/subscriptions","organizations_url":"https://api.github.com/users/DQM4HEP/orgs","repos_url":"https://api.github.com/users/DQM4HEP/repos","events_url":"https://api.github.com/users/DQM4HEP/events{/privacy}","received_events_url":"https://api.github.com/users/DQM4HEP/received_events","type":"Organization","site_admin":false},"repo":{"id":79259033,"node_id":"MDEwOlJlcG9zaXRvcnk3OTI1OTAzMw==","name":"dqm4hep-core","full_name":"DQM4HEP/dqm4hep-core","owner":{"login":"DQM4HEP","id":16612352,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NjEyMzUy","avatar_url":"https://avatars3.githubusercontent.com/u/16612352?v=4","gravatar_id":"","url":"https://api.github.com/users/DQM4HEP","html_url":"https://github.com/DQM4HEP","followers_url":"https://api.github.com/users/DQM4HEP/followers","following_url":"https://api.github.com/users/DQM4HEP/following{/other_user}","gists_url":"https://api.github.com/users/DQM4HEP/gists{/gist_id}","starred_url":"https://api.github.com/users/DQM4HEP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DQM4HEP/subscriptions","organizations_url":"https://api.github.com/users/DQM4HEP/orgs","repos_url":"https://api.github.com/users/DQM4HEP/repos","events_url":"https://api.github.com/users/DQM4HEP/events{/privacy}","received_events_url":"https://api.github.com/users/DQM4HEP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DQM4HEP/dqm4hep-core","description":"DQM4HEP core implementation ","fork":false,"url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core","forks_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/forks","keys_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/teams","hooks_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/hooks","issue_events_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/issues/events{/number}","events_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/events","assignees_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/assignees{/user}","branches_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/branches{/branch}","tags_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/tags","blobs_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/statuses/{sha}","languages_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/languages","stargazers_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/stargazers","contributors_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/contributors","subscribers_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/subscribers","subscription_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/subscription","commits_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/contents/{+path}","compare_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/merges","archive_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/downloads","issues_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/issues{/number}","pulls_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/pulls{/number}","milestones_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/milestones{/number}","notifications_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/labels{/name}","releases_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/releases{/id}","deployments_url":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/deployments","created_at":"2017-01-17T18:39:22Z","updated_at":"2018-06-10T23:04:07Z","pushed_at":"2018-06-10T23:04:06Z","git_url":"git://github.com/DQM4HEP/dqm4hep-core.git","ssh_url":"git@github.com:DQM4HEP/dqm4hep-core.git","clone_url":"https://github.com/DQM4HEP/dqm4hep-core.git","svn_url":"https://github.com/DQM4HEP/dqm4hep-core","homepage":"","size":2156,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":3,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/pulls/62"},"html":{"href":"https://github.com/DQM4HEP/dqm4hep-core/pull/62"},"issue":{"href":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/issues/62"},"comments":{"href":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/DQM4HEP/dqm4hep-core/statuses/74648743c0b93974a1b6e7e5941e7005453e5954"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"apingault"}}