# File System User Guide

The File System Module provides a portable API for dealing with File I/O. It manages access to a slow device in a coordinated and flexible way to help keep load times reasonable.

## Library organization

The library is built in three layers:

1. Device driver. Each device that the library knows about must have a driver
which translates library calls into O/S calls. Drivers are always called from secondary threads so they may block while the thread which initiated the request (usually the main thread) continues to run.
2. Primitive layer. Immediately above the driver layer is the primitive layer.
This layer sends messages to a device to execute a operation (such as Open or Read). The primitive level functions simply schedule the operation to execute and return, they do not wait for it to complete. Later, the device thread picks up the command and executes it using the device driver layer.
3. higher level modules are the load/save and streaming modules.