Re: Obtain filenames from a directory (Pcap program)



The glob function does give me the filenames of all the files in the
directory, but I still have trouble getting pcap_open_offline to read
from all the pcap files.

I now have

glob_t globbuf;
glob("/data/traffic/*.pcap", GLOB_ERR, NULL, &globbuf);
handle = pcap_open_offline(*(globbuf.gl_pathv), errbuf);

However, pcap_open_offline would only process the first pcap file in
the globbuf.gl_pathv list. How do I get pcap_open_offline to process
all files in the directory? Or do I need to use another function?

Thank you.
.