Android Question Case sensitive or NOT case sensitive?[Sort of Solved]

Roger Daley

Well-Known Member
Licensed User
Hi All,

I have been chasing down how to detect/correct if a user uses uppercase instead of lowercase to name a file. I had this as a concern on the understanding Android is case sensitive. Point is moot.
After many puzzling outcomes I ran this sub. The file IMPSITELIST.CSV is in Dir ABT, no lowercase equivalent is there. The file is found whether File.Exist uses Uppercase or lowercase.

Does anybody know how to tell if a function in B4A is actually case sensitive?

Regards Roger

Sub BtnSiteListPlus_click
   If File.Exists(File.DirRootExternal&"/ABT/", "impsitelist.csv") Then Log("lowercase found")
   If File.Exists(File.DirRootExternal&"/ABT/", "IMPSITELIST.CSV") Then Log("UPPERCASE FOUND")

Roger Daley

Well-Known Member
Licensed User

It is not so much the case being important to me, it is if the user uses the wrong case will it affect the program.
From the example above it would appear that File.Exists is not a problem but...
I have just run code containing:

If File.Exists(File.DirRootExternal&"/ABT/", "impsitelist.csv") = False Then
        CustomToastMsg.Show("File 'impsitelist.csv' not found",1000,Gravity.TOP,0,25%y)
End If
The CustomToastMsg is displayed, this is very confusing.

The critical point in the code is:
   Table = su.LoadCSV(File.DirRootExternal&"/ABT/", "impsitelist.csv",",")
This appears to be case sensitive, perhaps I need to revisit detecting/correcting filenames in the wrong case. This is going to lead to many more questions as I don't seem to be able to get this working.

Regards Roger the baffled.