Sample Header Ad - 728x90

Should the sdcard support case-sensitive files?

2 votes
1 answer
1728 views
I've been testing one of my apps to see how it handles filenames in UPPER-CASE. I *thought* the Android libraries and system was case sensitive for filenames, however I eventually discovered that files on the SD card are matched without case-sensitivity. Here's an example taken from a Samsung Ace phone (my Nexus 4 behaves similarly)
adb shell

$ pwd
/mnt/sdcard/testDaisyReader/casesensitivebook

$ echo "" > NCC.HTML
$ ls -l
-rwxrwxr-x system   sdcard_rw        1 2013-11-19 18:57 NCC.HTML
$ ls -l NCC.HTML
-rwxrwxr-x system   sdcard_rw        1 2013-11-19 18:57 NCC.HTML
$ ls -l ncc.html
-rwxrwxr-x system   sdcard_rw        1 2013-11-19 18:57 ncc.html
$ ls -l
-rwxrwxr-x system   sdcard_rw        1 2013-11-19 18:57 NCC.HTML
$ 
I would have expected the commands ls -l ncc.html wouldn't find the file I created, however it seems to do so. My Android app also matches files without case-sensitivity. Do any of you have any counter-examples? I'd like to know whether it's safe to assume filenames are matched on the SD-Card in Android, like Windows, without case-sensitivity. Notes: 1. the filesystem on the SD-Cards are FAT32 2. I've found 2 related posts that imply files on the sdcard are case-sensitive: https://android.stackexchange.com/questions/4775/how-can-i-open-an-html-file-i-have-copied-from-pc-to-sd-card-of-phone/47444#47444 https://android.stackexchange.com/questions/55481/how-can-i-determine-the-sd-cards-path/55482#55482
Asked by JulianHarty (131 rep)
Nov 19, 2013, 07:19 PM
Last activity: Nov 21, 2013, 09:47 PM