title: Get file permissions in Android (root)
body: <p>After some play around with rooted devices, I got stuck on the files. Let's say we have a file somewhere in the root folder which I want to read/write from my application. The only way I found so far is changing the file permission like</p>
  
  <pre><code>String [] cmd = { "su", "-c", "chmod", "777", path};
  Process process = new ProcessBuilder(cmd).start();
  process.waitFor();
  </code></pre>
  
  <p>This works fine, the problem is that I want to return back the original file permissions after I'm done with it. </p>
  
  <p>Can anybody help me with getting a file/directory current permissions?</p>