tcpdump mailing list archives

RE: listing all devs


From: "Fulvio Risso" <fulvio.risso () polito it>
Date: Tue, 13 May 2003 09:14:16 +0200



-----Original Message-----
From: owner-tcpdump-workers () sandelman ottawa on ca
[mailto:owner-tcpdump-workers () sandelman ottawa on ca]On Behalf Of Guy
Harris
Sent: lunedi 12 maggio 2003 21.01
To: Fulvio Risso
Cc: Gisle Vanem; tcpdump
Subject: Re: [tcpdump-workers] listing all devs


On Mon, May 12, 2003 at 09:14:11AM +0200, Fulvio Risso wrote:
 List all capture files in dir: tcpdump -i file://dir/?

This is actually unsupported. It should be a good suggestion.

However, this is a pain from the implementation point of view, since
file listing is platform independent.

(Presumably you meant "platform dependent".)

ehm...


SO, your code will have tons of
"#define" and this is something I would like to avoid (basically because
I'm using only Win32, Linux and BSD, and I'm not able to implement and
test the code on other platforms).

Any UNIX so old as not to have "readdir()" isn't likely to be
interesting for libpcap, so all you have to worry about is Win32 and
UNIX.

However, the problem then is that to list all capture files you'd have
to try to open *all* files in the directory and see which ones are
libpcap-format files - at least on UNIX, there's no guarantee that you
can determine the file type based purely on the file extension, and, as
you can move files between UNIX and Windows, there's really no such
guarantee on Windows, either.

You can always list the entire content of the selected folder.

        fulvio

-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe


Current thread: