Example: lr.redirect

In the following example the lr.redirect function instructs VuGen to redirect the Java output and error streams to the my_messages.txt file.

int rc;

/* Overwrite the file if it exists. If there is no file, create it. 
    If there is no "K" drive, the redirect fails. */
rc = lr.redirect ("K:\\temp\\my_messages.txt",
    "Application running!", false); 

if ( rc == lr.FAIL ) 
    /* Append the string to the local error file if it exists. 
        If there is no file, create it. */
        "Redirect failed!"); 
} else // Redirect succeeded.
    /* Write to the message to redirect
        target file on K: */
        "Redirect succeeded!");