forked from AmhCS/SysII-FS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExternalTools.java
More file actions
29 lines (24 loc) · 840 Bytes
/
ExternalTools.java
File metadata and controls
29 lines (24 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package external_tools;
public class ExternalTools {
public static void main(String Args[]) {
String filename = "block-device.data";
if ( Args.length == 0 ) {
System.out.println("Incorrect usage.");
System.out.println("Usage: ExternalTools <mode> <file>");
System.out.println("Mode is 0 for format, 1 for makefile and 2 for readfile");
System.out.println("File is only supplied for modes 1 and 2, indicating the file to be made or read, respectively.");
}
else if ( Args[0].equals("0") ) {
new FSformat().start(filename);
}
else if ( Args[0].equals("1") && Args.length == 2 ) {
new FSmakefile().start(Args[1],filename);
}
else if ( Args[0].equals("2") && Args.length == 2 ) {
new FSreadfile().start(Args[1],filename);
}
else {
System.out.println("Invalid argument(s).");
}
}
}