# Change to hadd that breaks previously working code

**URL:** <https://root-forum.cern.ch/t/change-to-hadd-that-breaks-previously-working-code/60126>\
**Category:** ROOT\
**Tags:** bug\
**Created:** [July 6, 2024, 10:38am UTC](https://root-forum.cern.ch/t/change-to-hadd-that-breaks-previously-working-code/60126 "2024-07-06T10:38:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JackLindon](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@JackLindon](https://root-forum.cern.ch/u/JackLindon)\
**Post date:** [July 6, 2024, 10:38am UTC](https://root-forum.cern.ch/t/change-to-hadd-that-breaks-previously-working-code/60126/1 "2024-07-06T10:38:23Z")

</div>

Hi,

I have some code that previously worked fine, however using a recent ROOT version it no longer works.

The problem comes when I try to hadd some files. These files are ROOT files, and can be opened fine e.g. looking at them in TBrowser they are fine, but their filename does not end in .root .

Previously hadding these was fine, but now when I try to hadd them I get the error:

hadd could not validate argument “\<filepath+name\>” as input file

I notice that in the most recent addition to hadd.cxx [[hadd] fix processing of indirect file when multiprocess is enabled (… · root-project/root@65fdf8c · GitHub](https://github.com/root-project/root/commit/65fdf8cc6ba98d386cae1a57e78e1b114357138c)

A check was added

```auto
         if (gSystem->AccessPathName(line.c_str(), kReadPermission) == kTRUE || (!TString(line).EndsWith(".root"))) {
            std::cerr << "hadd could not validate argument \"" << line << "\" as input file " << std::endl;

```

So hadd now fails on any file that does not end .root. Is there an option to avoid this check, and if not could one please be added? Or ideally could this check be changed to properly check if a file is a ROOT file rather than just guessing based on the filename (I guess using isZombie() could work?)

Thank you,  
Jack

* * *

_ROOT Version:_ 6.32.02  
_Platform:_ linuxx8664gcc  
_Compiler:_ g++ (GCC) 13.1.0

* * *

---

<div class="post-metadata">

**Author:** ![mczurylo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mczurylo/32/33269_2.png) [@mczurylo](https://root-forum.cern.ch/u/mczurylo)\
**Post date:** [July 8, 2024, 7:13am UTC](https://root-forum.cern.ch/t/change-to-hadd-that-breaks-previously-working-code/60126/2 "2024-07-08T07:13:39Z")

</div>

Hi @JackLindon,

thank you for your inquiry. I believe either @pcanal or @vpadulan could comment on this further.

Cheers,  
Marta

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [July 8, 2024, 12:32pm UTC](https://root-forum.cern.ch/t/change-to-hadd-that-breaks-previously-working-code/60126/3 "2024-07-08T12:32:29Z")

</div>

Thanks for the report. See a proposed fix here following your suggestion: [[hadd] allow ROOT files without .root extension by ferdymercury · Pull Request #16001 · root-project/root · GitHub](https://github.com/root-project/root/pull/16001)

---

<div class="post-metadata">

**Author:** ![JackLindon](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@JackLindon](https://root-forum.cern.ch/u/JackLindon)\
**Post date:** [July 8, 2024, 12:52pm UTC](https://root-forum.cern.ch/t/change-to-hadd-that-breaks-previously-working-code/60126/4 "2024-07-08T12:52:28Z")

</div>

Hi Marta and Ferhue,

Thank you very much for the fix.

Cheers,  
Jack

---

<div class="post-metadata">

**Author:** ![wiso](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wiso/32/11120_2.png) [@wiso](https://root-forum.cern.ch/u/wiso)\
**Post date:** [July 15, 2024, 1:34pm UTC](https://root-forum.cern.ch/t/change-to-hadd-that-breaks-previously-working-code/60126/5 "2024-07-15T13:34:23Z")

</div>

Is there any workaround in 6.32?

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [July 15, 2024, 1:50pm UTC](https://root-forum.cern.ch/t/change-to-hadd-that-breaks-previously-working-code/60126/6 "2024-07-15T13:50:13Z")

</div>

You could create a symbolic link between filename and filename.root

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [July 29, 2024, 1:50pm UTC](https://root-forum.cern.ch/t/change-to-hadd-that-breaks-previously-working-code/60126/7 "2024-07-29T13:50:59Z")

</div>

Closed on July 29, 2024, 1:50pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
