简体   繁体   English

Android SD卡文件系统

[英]Android SD card filesystem

Long story short - how do I check what filesystem is used on the SD card? 长话短说-如何检查SD卡上使用的文件系统?

I'd like to be able to differentiate between FAT and NTFS. 我希望能够区分FAT和NTFS。

One way is to parse output of mount command 一种方法是解析mount命令的输出

Edit: here is the code 编辑:这是代码

proc = Runtime.getRuntime().exec("mount");
BufferedReader in = new BufferedReader(new InputStreamReader(proc .getInputStream()));
String line = null;

while ((line = in.readLine()) != null) {  
//parse here
}

you will have to parse string line to check the filesystem for sdcard. 您将必须分析字符串行以检查sdcard的文件系统。 I think it should work for non rooted devices also 我认为它也应适用于无根设备

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM