The code — phase 3

In the last phase of our project, we're going to change from managing one file at a time to managing multiple counters.

What this means is that we'll take over a directory instead of a file or two, and we'll be able to present multiple counters. This is useful in the real world if, for example, you want to be able to maintain separate counters for several web pages.

Before we tackle that, though, it's worthwhile to note that you could achieve a similar effect by simply performing more resmgr_attach() calls; one pair of resources (the GIF-encoded and the text file) per web counter. The practical downside of doing this is that if you are going to be attaching a lot of pathnames, Neutrino's process manager will need to search through a linear list in order to find the one that the client has opened. Once that search is completed and the resource is opened, however, the code path is identical. All we're doing by creating a directory instead of a pathname is moving the pathname-matching code into our resource manager instead of the process manager.

The main differences from the previous version will be: