/storage/sdcard, /sdcard, /mnt/sdcard 三者的区别
区别 Storage 三者
2023-09-14 09:11:29 时间
public static final String SDPATH = Environment .getExternalStorageDirectory().getAbsolutePath();
//获取外部存储的路径返回绝对路径的,其实就是你的SD卡的文件路径
/storage/sdcard
/sdcard
/mnt/sdcard
以上三者的区别?
/sdcard是/mnt/sdcard的符号链,指向/mnt/sdcard,
/storage/sdcard 是sdcard的分区……
/sdcard/: this is a symlink to...
/mnt/sdcard (Android < 4.0)
/storage/sdcard0 (Android 4.0+)
/storage/emulated/0/
: to my knowledge, this refers to the "emulated MMC" ("owner part"). Usually this is the internal one. The "0" stands for the user here, "0" is the first user aka device-owner. If you create additional users, this number will increment for each./storage/emulated/legacy/
as before, but pointing to the part of the currently working user (for the owner, this would be a symlink to/storage/emulated/0/
). So this path should bring every user to his "part"./sdcard/
: According to a comment by Shywim, this is a symlink to.../mnt/sdcard
(Android < 4.0)/storage/sdcard0
(Android 4.0+)
/storage/sdcard0/
: As there's nolegacy
pendant here (see comments below), the "0" in this case rather identifies the device (card) itself. One could, eventually, connect a card reader with another SDCard via OTG, which then would become/storage/sdcard1
(no proof for that, just a guess -- but I'd say a good one)
internal storage - Confused by the many locations of the virtual /sdcard/ - Android Enthusiasts Stack Exchange
http://android.stackexchange.com/questions/39542/confused-by-the-many-locations-of-the-virtual-sdcard
相关文章
- HashMap和HashSet的区别
- const 和宏的区别
- prepareStatement与Statement的区别
- select into from 提示 Undeclared variable.....错误的解决办法 && select into from 和 insert into select 的用法和区别
- getField()和select()方法的区别
- [Java] equals与==的区别
- svn checkout与git clone的区别:svn当项目已经checkout过自动拉取最新版本代码,而git会报错
- block、inline、inline-block的区别
- Cookie和Session的作用,区别和各自的应用范围,Session工作原理
- C++之auto与decltype用法区别(一百一二十五)
- Android 中 Internal Storage 和 External Storage 的区别
- Kettle 和 SSIS 的区别研究 (Kettle 循环遍历)
- 验证与确认的区别,你知道吗