473,324 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Obtain filenames from a directory (Pcap program)

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
Nov 19 '08 #1
1 2630
"lancer6...@yahoo.com" <lancer6...@yahoo.comwrote:
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

--
Peter
Nov 19 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Marian Aldenhövel | last post by:
Hi, I am very new to Python and have run into the following problem. If I do something like dir = os.listdir(somepath) for d in dir: print d The program fails for filenames that contain...
5
by: Tony Gahlinger | last post by:
In reading up on raw socket programming under RedHat 9.2, I come across 'typedef struct pcap pcap_t' in pcap.h. Ok, so pcap_t is of type pcap, but I can't find any include file that tells me what...
2
by: rbutch | last post by:
guys, i need a little help with this. this is working (well sort of) i get the info, but it's not moving to a new line as it iterates thru the array and all of the fields are like ONE HUGE LONG...
6
by: I_AM_DON_AND_YOU? | last post by:
I have a small VB.Net Solution. The solution has filename LABELMAKER.SLN and the the project has filename LABELMAKER.VBPROJ. There is another file LABELMAKER.VBPROJ.USER. All these are in a...
6
by: Willie wjb | last post by:
Hi, i created a windows service. This service is installed in some c:\program files\x directory when started it needs the directory in which it is started. when i use the...
1
by: amc river | last post by:
Hi, Anyone know of if there is a java class that extract every field of a pcap format file? thanks
5
by: dananrg | last post by:
Is there a standard library module in Python 2.4 (Win32) that will return directory permissions / ACLs (e.g. users, groups, and what rights they have)? Otherwise, I'm faced with sending "cacls...
0
by: Astan Chee | last post by:
Hi, Im using pyflag to parse .pcap files. Pyflag displays the data part of the .pcap file in binary and I was wondering what this means. How do I decode the 'data' part of the packet without using...
2
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
Hi, I work in a company where we tend to use very deep folder structures and long descriptive file names due to the nature of the analysis that we make. I've made a program that recursively...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.