Share this page

# 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;
    lr.enable_redirection(true);

    /* 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. */
        lr.redirect("d:\\temp\\VuGen_err.txt",
            "Redirect failed!");
    } else // Redirect succeeded.
    {
        /* Write to the message to redirect
            target file on K: */
        lr.redirect("K:\\temp\\my_messages.txt",
            "Redirect succeeded!");
    }
    lr.enable_redirection(false);

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: