Howto read /dev/mtd/mtd1

Put your problem here if it does not fit any of the other categories.

Howto read /dev/mtd/mtd1

Postby FireFart » Thu Aug 13, 2009 9:35 pm

I have to read the File /dev/mtd/mtd1 on my Android.
Actually this is what i am supposed to do:
md5sum /dev/mtd/mtd1

Now heres my Problem:
I can create the File object, and File.exists() returns true.
But i cannot read the File in. The BufferedReader throws no Exception, it just returns null. When i connect via adb i can access this File.

The Permissions are:
crw------- 1 0 0 90, 2 Aug 13 05:07 mtd1

Is there a way to read the File via an AndroidApp?

Heres to codepart:
public static String calculateMD5(File updateFile) throws IOException {
String calculatedDigest;
Process process = Runtime.getRuntime().exec(
new String[] { MD5_COMMAND, updateFile.getAbsolutePath() });

try {
BufferedReader br = new BufferedReader(new InputStreamReader(
process.getInputStream()), 1024);
calculatedDigest = br.readLine();

br.readLine() just returns null
Posts: 3
Joined: Wed Aug 12, 2009 7:06 pm


Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 5 guests