Callback mode

By default CBFS Storage keeps the storage in the file located on the disk. However, CBFS Storage engine doesn't really care about where the data is stored. You can keep the storage in the file or on raw disk partition, in memory or somewhere across the network. The only thing CBFS Storage needs is possibility to get random access to the pages of the storage.

To keep the storage in other locations, you need to use so-called callback mode (read the general introduction to the callback mode online in CBFS Storage knowledgebase). In this mode CBFS Storage will fire various OnFile* events (see the event list below) which you must handle. The events are not hard to handle and they all map quite closely to Windows File API. The events were designed to be very easy to implement. Actual processing of each of the 10 events that you need to handle can take as little as one call to the underlying API.

One of scenarios for use of the callback mode is keeping the compound file in memory for fast operations. For example, help authoring tool, used to create this Help file, stores all topics in separate files in CBFS Storage storage. The storage itself is a help project. Help authoring tool loads the help project to the memory stream and uses the callback mode to work with the storage. When the user needs to save the project, the storage is flushed and the memory stream is copied to the disk file.

Read more about callbacks in the How-to section