tcpdump mailing list archives
Fw: listing all devs
From: "Loris Degioanni" <loris () netgroup-serv polito it>
Date: Tue, 13 May 2003 10:05:24 +0200
Hi,
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.
Yes, but I don't see this like a terrible problem. I agree that you need to open the file, but understanding if it's a libpcap capture is quite easy thanks to the magic number at the beginning of the file. Loris - 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:
- RE: listing all devs, (continued)
- RE: listing all devs Fulvio Risso (May 12)
- Re: listing all devs Guy Harris (May 12)
- RE: listing all devs Fulvio Risso (May 13)
- Re: listing all devs Gisle Vanem (May 13)
- RE: listing all devs Fulvio Risso (May 14)
- Re: listing all devs Guy Harris (May 12)
- RE: listing all devs Fulvio Risso (May 12)
- Re: listing all devs David Young (May 14)
- Re: listing all devs Gisle Vanem (May 15)
- RE: listing all devs Fulvio Risso (May 15)
- Re: listing all devs David Young (May 15)
- Re: listing all devs Guy Harris (May 15)
- Re: listing all devs Gisle Vanem (May 15)
- Fw: listing all devs Loris Degioanni (May 13)