Connecting Tech Pros Worldwide Forums | Help | Site Map

Obtain filenames from a directory (Pcap program)

lancer6238@yahoo.com
Guest
 
Posts: n/a
#1: Nov 19 '08
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

Peter Nilsson
Guest
 
Posts: n/a
#2: Nov 19 '08

re: Obtain filenames from a directory (Pcap program)


"lancer6...@yahoo.com" <lancer6...@yahoo.comwrote:
Quote:
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.
Quote:
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

--
Peter
Closed Thread