Re: expat question: processStream vs processFile/filemap
James Clark (jjc@jclark.com)
Mon, 04 May 1998 17:03:12 +0700
James K. Tauber wrote:
>
> As I've mentioned before, I'm writing some documentation for expat and I'm
> currently doing a walkthrough of xmlwf. My lack of knowledge of C file I/O
> is letting me down.
>
> Can somebody who has worked with the expat source (or who is at least
> willing to have a quick look at xmlwf.c) tell me what the difference is
> between using processStream and using processFile/filemap? Why is it a
> command-line option?
> Why would you pick one over the other?
Using file mapping is typically more efficient, but you might need to
use processStream if:
- your OS doesn't support file mapping (although xmlwf can fake it by
reading the entire file into memory)
- you don't want to deal with the portability problems that using file
mapping brings
- you have files larger than can be mapped (eg > 2Gb)
- you are reading from a network connection or pipe rather than a file
It's a command-line option for testing purposes.
James