Obtain filenames from a directory (Pcap program)

L

lancer6238

Hi all,
I'm writing a program using libpcap, and I have multiple pcap files in
a folder that I want to capture.

I currently have

handle = pcap_open_offline("/data/traffic/pcap1.pcap", errbuf");

which works fine since pcap_open_offline() takes in a filename.
However, I want to process multiple pcap files from the directory /
data/traffic/ at once. Is there a way to do that?

Thank you.

Regards,
Rayne
 
P

Peter Nilsson

Hi all,
I'm writing a program using libpcap, and I have
multiple pcap files in a folder that I want to capture.

I currently have

handle = pcap_open_offline("/data/traffic/pcap1.pcap", errbuf");

I doubt have that. That is unlikely to even compile.
which works fine since pcap_open_offline() takes in a
filename. However, I want to process multiple pcap files
from the directory /data/traffic/ at once. Is there a way
to do that?

Not in standard C which is the topic of comp.lang.c.

See the FAQ...

http://c-faq.com/osdep/readdir.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top