The DAT file is used to define the structure of the file system when wince is started, that is, to define the folders and locations of the files. During each cold start, the filesys module creates directories and files under directories Based on the content in the. dat file.
In BSP, We can find platform. dat. After creating an wince project, you can find project. dat under the project directory. You can define the required root directory and corresponding subdirectories and files in these two. DAT files, except for Windows folders and Their subfolders. You can reference files in the Windows directory by defining shortcuts.
The following is an example of the specific format of the DAT file:
root:-Directory("My Documents")
root:-Directory("Program Files")
Directory("Program Files"):-Directory("My Projects")
Directory("Program Files"):-Directory("Accessories")
Directory("Program Files"):-Directory("Communication")
Directory("Program FilesMy Projects"):-File("My Project Program", "WindowsMyproj.exe")
root:-File("control.lnk", "Windowscontrol.lnk")
For a brief explanation, the above content is to first create two root directories, my documents and program files, and then create the my documents file under program files to the my projects directory, and the name is my project program. In this example, all files such as myproj.exe are copied from the Rom, so they must be included in the bib file. The last line indicates creating control. lnk in the root path. This file is from the control. lnk file in the ROM and is a shortcut file.
The preceding formats are explained as follows:
1. Syntax format of root directory:
root:[-Directory("dir_name")] [-Permdir("dir_name")]
[-File("target_filename", "source_location")]
Root: indicates the root directory.
-Directory ("dir_name"): defines the directory name under the root directory.
-Permdir ("dir_name"): defines a permanent Directory, which cannot be deleted using the removedirectory function.
-File ("target_filename", "source_location"): defines a target file, which is copied from the Rom. Target_filename is the name of the target file, and source_location is the file in ROM, which is the name of a file in a path under the Windows directory.
2. Syntax format of directory:
Directory("dir_name"):[-Directory("dir_name")]
[-File("target_filename", "source_location")]
Directory ("dir_name"): indicates the directory name ."" Indicates the root directory.
-Directory ("dir_name"): indicates the path under the Directory, which is a subdirectory.
-File ("target_filename", "source_location"): defines a target file, which is copied from the Rom. Target_filename is the name of the target file, and source_location is the file in ROM, which is the name of a file in a path under the Windows directory.
The syntax used in dat is relatively simple. Let's look at the example to know how to modify it. Generally, we will change the file path structure after wince is started by modifying project. dat and platform. dat. Among them, platform. dat is related to the platform, while project. dat is related to the wince project.