Hi, i am trying to redirect the stdout to a file, i used JNI to run JBoss from jar file but i canīt redirect the output can some one help me here its the code i am trying to do:
Code:
int main(int argc, char **argv) {
FILE *stream;
char linea[1024];
JNIEnv* env = create_vm();
stream = freopen("file.txt", "w", stdout);
invoke_class( env );
fprintf(stream,stdout);
//stream = freopen("CON", "w", stdout);
/*stream = fopen("file3.txt","w");
stdout>stream;*/
/*while(stdout!=NULL)
fprintf(stream,stdout);*/
getchar();
}
i have alredy play with stdout but i canīt manipulate it
Thanks in advance