Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.FileReader;
- import java.io.IOException;
- import java.util.StringTokenizer;
- public class detect
- {
- private static boolean is64() throws IOException
- {
- BufferedReader in = new BufferedReader(new FileReader("/proc/cpuinfo"));
- String line = null;
- while((line = in.readLine()) != null) {
- if(line.startsWith("flags ")) {
- StringTokenizer flags = new StringTokenizer(line, " ");
- while(flags.hasMoreTokens())
- if(flags.nextToken().equals("lm"))
- return true;
- break;
- }
- }
- return false;
- }
- public static void main(String args[]) throws IOException
- {
- if(is64())
- System.out.println("64");
- else
- System.out.println("32");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement