tcpdump mailing list archives

Re: listing all devs


From: Guy Harris <guy () netapp com>
Date: Mon, 12 May 2003 12:00:33 -0700

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".)

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.
-
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: