@okulev, I like the fact that you got rid of the static `300` to allocate pathnames. On the other hand, since this loop does not go through a lot of iterations, I prefer the approach of keeping it as a function (`get_file_path`) for clarity while reading the code as a new user.

Alternatively, commenting what this code is doing could be very helpful when reading through it. What do you think?