Commit | Line | Data |
---|---|---|
1 | main(argc,args) | |
2 | char **args ; | |
3 | { | |
4 | register char *tape ; | |
5 | int i , j ; | |
6 | ||
7 | if (argc > 2) { | |
8 | usage : | |
9 | printf("usage : rew [[m]digit]\n") ; | |
10 | exit(1) ; | |
11 | } | |
12 | tape = "/dev/tap0" ; | |
13 | if (argc > 1) { | |
14 | j = 0 ; | |
15 | if (args[1][j] == 'm') { | |
16 | tape = "/dev/mt0" ; | |
17 | i = 7 ; | |
18 | j++ ; | |
19 | } | |
20 | else i = 8 ; | |
21 | if (args[1][j] != '\0') tape[i] = args[1][j] ; | |
22 | } | |
23 | i = open(tape,0) ; | |
24 | read(i,&j,sizeof(j)) ; | |
25 | close(i) ; | |
26 | } |