I have a scenario where I want to search my directory for all the files which have ".ip" in their filename and then read the filenames(I don’t need to open the file). I also need the time-stamp for each files and store them. I am using a Linux system and would like the solution to be in C++ or C.
Here’s what my directory looks like:
MyFolder/Data ── server.linux.config ── linux.126.96.36.199:9000.ip ── windows.188.8.131.52:3050.ip ── local.127.0.0.1:8080.ip ── server.bin ── keys.bin
For example, I need to need to read the filename "linux.184.108.40.206:9000.ip" since it has "ip" in its file name and get ip_address "220.127.116.11", port no. "9000", system "linux" after reading the name and then the time-stamp of the file.
Source: Windows Questions C++