diff options
Diffstat (limited to 'mypath/runjv.c')
-rw-r--r-- | mypath/runjv.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/mypath/runjv.c b/mypath/runjv.c deleted file mode 100644 index 74efb72..0000000 --- a/mypath/runjv.c +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | #include <string.h> | ||
4 | |||
5 | #ifdef _WIN32 | ||
6 | #define DELETE_COMMAND "del" | ||
7 | #else | ||
8 | #define DELETE_COMMAND "rm -rf" | ||
9 | #endif | ||
10 | |||
11 | |||
12 | int main(int argc, char* argv[]) | ||
13 | { | ||
14 | char* command; | ||
15 | if(argc!=2) | ||
16 | { | ||
17 | printf("Number of parameters Wrong!\n"); | ||
18 | printf("Usage: runjv <filename>\n"); | ||
19 | return 1; | ||
20 | } | ||
21 | command=(char*)malloc(sizeof(char)*(strlen(argv[1])+10)); | ||
22 | |||
23 | char* classname=strtok(argv[1],"."); | ||
24 | |||
25 | sprintf(command,"javac %s.java",classname); | ||
26 | int command_status=system(command); | ||
27 | |||
28 | if(command_status!=0) | ||
29 | { | ||
30 | printf("Compile Failed!\n"); | ||
31 | return -1; | ||
32 | } | ||
33 | sprintf(command,"java %s",classname); | ||
34 | system(command); | ||
35 | |||
36 | sprintf(command,"%s %s.class",DELETE_COMMAND,classname); | ||
37 | system(command); | ||
38 | return 0; | ||
39 | } | ||