Wireshark-dev: Re: [Wireshark-dev] Reduce memory consumption by re-reading data from file for r
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 3 Nov 2010 14:59:26 -0700

On Nov 3, 2010, at 1:28 PM, Jakub Zawadzki wrote:

Still it's lot easier to work with than fread() + fseek()

...as long as you're in a situation where you won't get any I/O errors, including errors due to timeouts on file servers if the capture file is on a server or due to an external hard drive being unplugged if the capture file is on a hard drive (you *shouldn't* just unplug external hard drives, you should "eject" them and then unplug them, but people probably will unplug them on occasion).  If you *could* get I/O errors, then, unless you want the I/O errors to crash your application, you need to catch the appropriate indication (SIGSEGV and/or SIGBUS on UN*X, presumably some exception on Windows) and somehow arrange to have it report an error.