how to print all the subfolders inside a folder c++ under ubuntu
I am new to c++/ubuntu. I have the following sittualtion: I want at every 2 seconds to read all the files(subfolders) from a folder and print them on the screen. If each subfolder has files I would also like to print those files too. In my sittuation I can only have a folder with subfolders that contains files.
Eg: folder primary-> subfolder 1 with: name.txt, age.txh; subfolder 2 with name.txt, age.txt.and so on. I would also like to specify THAT i do not know the total number of subfolders because it will increase or decrease dynamically.

1. How to create a thread for 2 second that will print the files from subfolders.
2. How to print the files from subfolders?

Can someone please print a c++ code example? THX! APPRECIATE A LOT!
how to print all the subfolders inside a folder c++ under ubuntu
===

I am new to c++/ubuntu. I have the following sittualtion: I want at every 2 seconds to read all the files(subfolders) from a folder and print them on the screen. If each subfolder has files I would also like to print those files too. In my sittuation I can only have a folder with subfolders that contains files.
Eg: folder primary-> subfolder 1 with: name.txt, age.txh; subfolder 2 with name.txt, age.txt.and so on. I would also like to specify THAT i do not know the total number of subfolders because it will increase or decrease dynamically.

1. How to create a thread for 2 second that will print the files from subfolders.
2. How to print the files from subfolders?

Can someone please print a c++ code example? THX! APPRECIATE A LOT!