write to file from Loadrunner controller

2k Views Asked by At

I'm using Loadrunner controller 11.51, I have an issue when trying to open file to write the output results using "fopen" function, the file is unable to open. please note that the code is work when I'm running it on a VUGen(11.51). it seems that its a permission issue in the "LoadGenerators" used in LoadController. if any of you had faced such problem please advise.

the snippet of code I'm using:

    if ((file_stream = fopen(filename, access_mode)) == NULL)  
    {
        lr_error_message ("Cannot open or create %s", filename);   
        return -1;  
    }
    else
    {    
        fprintf(file_stream, "%s", "MyInfo" );
        fclose(file_stream);
    }

the returned value from fopen(filename, access_mode) function when I'm running the script from using Loadrunner controller is always null.

1

There are 1 best solutions below

0
On

I've tried a work around solution for solving the issue and it get solved by putting the Controller machine as a generator, as by default the controller have full permission to its machine.