# Files generated during replay

This section describes what occurs when a Vuser script is replayed, and describes the files that are created.

1. The options.txt file is created. This file includes command line parameters to the preprocessor.

Example of options.txt file

-DCCI
-D_IDA_XL
-DWINNT
-Ic:\tmp\Vuser                  (name and location of Vuser include files)
-IE:\LRUN45B2\include           (name and location of include files)
-ec:\tmp\Vuser\logfile.log      (name and location of output logfile)
c:\tmp\Vuser\VUSER.c           (name and location of file to be processed)

2. The file Vuser.c is created. This file contains 'includes' to all the relevant .c and .h files.

Example of Vuser.c file

#include "E:\LRUN45B2\include\lrun.h"
#include "c:\tmp\web\init.c"
#include "c:\tmp\web\run.c"
#include "c:\tmp\web\end.c"

3. The c preprocessor cpp.exe is invoked in order to 'fill in' any macro definitions, precompiler directives, and so on, from the development files.

The following command line is used:

cpp -foptions.txt

4. The file pre_cci.c is created which is also a C file (pre_cci.c is defined in the options.txt file). The file logfile.log (also defined in options.txt) is created containing any output of this process. This file should be empty if there are no problems with the preprocessing stage. If the file is not empty then it is almost certain that the next stage of compilation will fail due to a fatal error.

5. The cci.exe C compiler is now invoked to create a platform-dependent pseudo-binary file (.ci) to be used by the Vuser driver program that will interpret it at runtime. The cci takes the pre_cci.c file as input.

6. The file pre_cci.ci is created as follows:

cci -errout c:\tmp\Vuser\logfile.log -c pre_cci.

7. The file logfile.log is the log file containing output of the compilation.

8. The file pre_cci.ci is now renamed to Vuser.ci.

Since the compilation can contain both warnings and errors, and since the driver does not know the results of this process, the driver first checks if there are entries in the logfile.log file. If there are, it then checks if the file Vuser.ci has been built. If the file size is not zero, it means that the cci has succeeded to compile - if not, then the compilation has failed and an error message will be given.

9. The relevant driver is now run, taking both the .usr file and the Vuser.ci file as input. For example:

mdrv.exe -usr c:\tmp\Vuser\.usr -out c:\tmp\Vuser -file c:\tmp\Vuser\Vuser.ci

The .usr file is needed since it tells the driver program which database is being used. This determines which libraries need to be loaded for the run.

10. If there is an existing replay log file, output.txt, (see the following entry), the log file is copied to output.bak.

11. The output.txt file is created (in the path defined by the 'out' variable). This file contains the output messages that were generated during the script replay. These are the same messages that appear in the Replay view of VuGen's Output pane.