Ethereal-users: Re: [Ethereal-users] tiny patch for ethereal-0.10.9

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Fri, 28 Jan 2005 03:36:26 -0800
Yoshihiro Oyama wrote:

 * add: "tethereal -r '-' < some packet file"

Checked in, with some changes:

	1) I removed the debugging messages;

2) I left the file type checks in - they should be done even when reading the standard input;

	3) on Windows, it sets the standard input to binary mode;

4) random mode won't work without a file name - it needs two completely independent file descriptors, with separate file offsets, but the only thing you can do with the standard input is to dup it, but "dup()" gives you a descriptor that shares a file offset with the original descriptor - so it checks for that and returns an error if you try to open "-" for random access. (Maybe on some UN*Xes you could do it with "/dev/stdin", if opening "/dev/stdin" behaves like an open rather than a dup, so that the new descriptor has a different file offset.)