Question

What should I do on Platform Builder (6.0R3) in order that the resulting image of a BSP I am working on, to have a directory named "abc" in the file system root. In addition, this directory has to have some files (executable and dll generated on .NET Compact 3.5).

I have searched, but only found how to add files to the Windows directory by editing Platform.bib, but not how to create a new directory with certain files in it.

Was it helpful?

Solution

You can use platform.dat file for Creating a directory and/or copying files to directory.

The commands, or file parameters, in DAT files are:

  • root, which designates the root folder.

  • Directory(“<Directory name>”), which is used to both designate a folder and to create a new folder.

  • Permdir(“<Directory name>”), which is used to create a new folder that cannot be deleted by the user.

  • File(“<destination file name>”, “<source path and file name>”), which is used to copy a file.

Create a folder

You can use DAT files to create a folder, or folder tree.

This is exactly what the DAT files in the Public folders do to create the directory structure that you see when you boot your system.

Example of creating \MyFolder\SubFolder using platform.dat:

root:-Directory("MyFolder")
Directory("\MyFolder "):-Permdir("SubFolder ")

Which does the following:

  1. Creates a folder named MyFolder in the root of the file system.

  2. Creates a folder named SubFolder in \MyFolder which cannot be deleted

Directory() is used in two ways; one to create a directory, and the other to specify a folder in which the new directory will be created.

Copy a File to a Folder

You can also use DAT files to copy files from the \Windows folder to one or the newly created folders.

Example of copying MyApp.lnk to \MyFolder\SubFolder:

Directory("\MyFolder \ SubFolder "):-File("MyApp.lnk", "\Windows\ MyApp.lnk")

Which copies \Windows\MyApp.lnk to \MyFolder\SubFolder\MyApp.lnk.

But what if you want to rename the file:

Directory("\MyFolder \ SubFolder "):-File("MyNewName.lnk", "\Windows\ MyApp.lnk")

Which renames MyApp.lnk to MyNewName.lnk when it copies it to \MyFolder\MySubfolder.

Source : Platform Builder: Using Dat Files to Initialize the File System - A blogpost by Bruce Eitman

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top