Rdir: search recursive for files with a given name pattern

Confirmed, you are not mistaken! - @rafael.guerra Thanks!

But the initial reason for my post is still open, why does the statement “global s_files” in my initial function does the opposite from what is expected, that it is not necessary in this situation is one thing, but that it does the opposite from what I would like to achieve (that it is made global over the whole function space) is strange to me.

global s_files would refer to the module scope outside the rdir() function, but this variable is there empty / not defined.

Local variables defined inside a function can be used inside the inner scope of for loops, annotating them as global would have the meaning above. But I might well be wrong.