troubleshooting Question

How to change dir when full path is not known in linux using c++?

Avatar of Pra Sys
Pra SysFlag for India asked on
LinuxCC++
9 Comments2 Solutions544 ViewsLast Modified:
I have a c++ program which processes a file and during that it creates few folders recursively at certain known path. The name of new folders are not known as they are created by another c++ program which is invoked internally by my program. One of the folder somewhere is "process". I need to change my current directory to "process" without directly knowing full path. Can someone tell how to do that?

For example - If I am running my program "sample" from /home/mumbaikar/cpp/sample, it creates input/1234/5678/abcd/process under  /home/mumbaikar/cpp/sample. I am only aware of input folder but not any folder after that till "process". Now I want to seek or change dir to "process".

How can I do it?

Thanks.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 9 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros