15.9. Creating a script that accesses a user-defined file

Many CLI commands enable you to redirect the output to user-defined files. In addition, you can read from and write to files using predefined macros.

To create a script that accesses a user-defined file:

  1. Create a script, and place the VOPEN command in your command script before any other commands that support file IDs.

    Alternatively, use the fopen predefined macro to open a file.

  2. For those commands that support file IDs, enter the ID of the file where the command output is to be directed.

  3. Place the VCLOSE command in your command script to close the file before the command script exits.

For example:

FOPEN 200, "c:\\myfiles\\data.txt"
FPRINTF 200, "message written to user-defined file"
VCLOSE 200

See also:

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0153N
Non-ConfidentialID052111