Utility Functions and C Language Reference > Utility Functions: Java (lr.) > Alphabetical Listing > lr.redirect


Redirects a string to a file.

Java Language

int lr.redirect( String file_name, String str, boolean append);
Example: lr.redirect Message Functions


Name Comments
file_name The file to which to redirect the string. If the file does not exist, it creates a new file. If the file does exist, it appends it to the file or overwrite the file (see the append argument)
str The string to redirect.
append An optional flag indicating whether to overwrite the specified file, or to append the string to the file. "false" indicates to overwrite the file. "true", the default, indicates to append the string to the file.

The lr.redirect function redirects a Java string to a file. If the specified file does not exist, VuGen creates the file. If it does exist, you can indicate whether to append or overwrite the file. By default, VuGen appends to the file.

To allow redirection, you need to enable redirection using the lr.enable_redirection function.

Return Values

This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure. Note that in many cases, this return value indicates the technical success of the function, and not the result. For example, a function that registers a string to be found in a subsequent step returns LR_PASS to indicate that the registration was successful. This does not indicate that the string was found in the server response.


You cannot use standard parameterization for any arguments in this function.