Hello everyone:
I have been using this command (below) to remove all files with a certain extension (here it is .pdf) from a directory. I use it by typing it directly into a terminal window.
find . -type f -name "*.pdf" -exec rm -f {} \;
Now I would like to program this into some C++ code. I have tried Google, but have not found any way to do this. Is there a way? If anyone could point me to an online resource or provide a simple example, I would be very grateful. Thanks!
The problem is that I want to put the command in a C++ program. I can't directly insert it into my code. I can only use it in a terminal. Thanks.
I have been using this command (below) to remove all files with a certain extension (here it is .pdf) from a directory. I use it by typing it directly into a terminal window.
find . -type f -name "*.pdf" -exec rm -f {} \;
Now I would like to program this into some C++ code. I have tried Google, but have not found any way to do this. Is there a way? If anyone could point me to an online resource or provide a simple example, I would be very grateful. Thanks!
The problem is that I want to put the command in a C++ program. I can't directly insert it into my code. I can only use it in a terminal. Thanks.