I have a function which takes a path and some other stuff. The function is used to go through directories and if there's another directory it should open that one as well. The problem I have is when I recursively call the function. Sorry for lack of information but I don't think more is needed. So when I recursively call my function it looks like this:
func(realpath(pDirent->d_name, buff), name, ...(flags)...);
where name is a the file I am looking for and pDirent->d_name
is the name of the folder which I now want to continue my search for the file, name.
And now to the problem. When I just send in realpath(pDirent->d_name, buff)
it doesn't work. So I think I need to add the pDirent->d_name
to my current path. I have looked around but I didn't find any way to do this. Essentially what I wanna do is add a "/" + pDirent->d_name
to my path string. Is there any function that will get this done?