Using the File System

Windows CE 3.0

Windows CE offers three types of file systems: a ROM-based file system, a RAM-based file system, and a FAT file system for Advanced Technology Attachment (ATA) devices, flash memory, and SRAM cards. In addition, embedded systems developers can create and register proprietary file systems. Regardless of the type of storage, all of the file systems are accessed via the Win32 file-system application programming interface (API).

As with the Microsoft Windows® desktop platforms, Windows CE uses handles for file access. The CreateFile function returns a handle that references the created or opened file. Subsequent read, write, and information functions all use that handle to determine the file on which to act. File read and write functions also use a file pointer to specify the location within a file in which the read or write operation takes place.

Windows CE uses a variety of techniques to simplify memory management and to reduce memory overhead. First, Windows CE does not use the current directory concept. Instead, all of the references to an object are given in the full path. Further, Windows CE automatically compresses all of the files in the object store; therefore, no file has a flag to indicate compression. Of course, a flag does exist that distinguishes between a file in ROM and a file in RAM.

On Windows CE version 2.0 and earlier, a file can be up to 4 MB in size. Directories, databases, the registry, and files on Windows CE version 2.10 and later are not limited to the 4-MB size restriction. In addition to the object store, a user can install a file system such as the FAT file system. An installed file system can provide access to a PC Card or to other external storage devices. You can divide an external storage device into multiple volumes, each of which is mounted separately. Each mounted volume is visible to the user as a folder in the root directory of the installed file system. While you can back up data to an external storage device, the working registry and RAM file system can exist only in the object store.

Note   For programming purposes, Windows CE considers the object store to be a special type of volume that is always mounted.