expat question: processStream vs processFile/filemap

James Clark jjc at jclark.com
Mon May 4 12:43:43 BST 1998


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



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list