Permalink
Browse files

Temp solution for java integration.

  • Loading branch information...
1 parent 2bfc316 commit 8d5f112c3fe78e983a1f584660805ba38e81fb25 @shashankkumar committed Mar 15, 2012
Showing with 26 additions and 0 deletions.
  1. +26 −0 Execution.cpp
View
@@ -170,13 +170,39 @@ int main(int args, char *argv[]){
if(alarm(TimeLimit)!=0){
ToPipe("IE ERROR Could not set alarm.");
}
+ /*
if(strcmp(lang,"java")==0){
SetResourceLimitValuesJava(TimeLimit);
if(execl("/usr/bin/java", "/usr/bin/java", "-Xmx4M", "-classpath", InputFile, (char *) NULL) == -1){
fclose(stdout);
ToPipe("IE ERROR File not present or some other error.");
}
}
+ */
+ if(strcmp(lang,"java")==0){
+
+ FILE *fpipe;
+ char command[100];
+ sprintf(command, "java Main < %s > %s", TestCaseFile, OutputFile);
+ char line[256];
+
+ if ( !(fpipe = (FILE*)popen(command,"r")) ){
+ perror("Problems with pipe");
+ //Logs::WriteLine("Problems with pipe");
+ }
+ else{
+ if ( fgets( line, sizeof line, fpipe)){
+ ;
+ }
+ }
+ pclose(fpipe);
+ exit(0);
+ if(execlp("/usr/bin/java", "/usr/bin/java", InputFile, InputFile, (char *) NULL) == -1){
+ fclose(stdout);
+ ToPipe("IE ERROR File not present or some other error.");
+ }
+
+
SetResourceLimitValues(TimeLimit);
if(strcmp(lang, "python")==0){
strcat(InputFile, ".pyc");

0 comments on commit 8d5f112

Please sign in to comment.