Case sensitivity

If your application is sensitive to mixed case, move it into the /QOpenSys file system, or into a user-defined file system that has been created as case-sensitive.

The interfaces of operating systems, such as AIX® and Linux, generally differentiate between uppercase and lowercase letters. On the IBM i operating system, that is not always the case. You should be aware of several situations in particular where case sensitivity might cause complications with existing codes.

Case sensitivity on a directory or file basis depends on the file system you are using on the IBM i operating system. The /QOpenSys file system is case-sensitive, and you can create a user-defined file system (UDFS) that is case-sensitive.

Examples

The following examples are problems stemming from case sensitivity that you might encounter.

Example 1

In this example, the shell does a character comparison of the generic name prefix against what is returned by readdir(). However, the QSYS.LIB file system returns directory entries in uppercase, so none of the entries matches the lowercase generic name prefix.

$ ls -d /qsys.lib/v4r5m0.lib/qwobj*
/qsys.lib/v4r5m0.lib/qwobj* not found
$ ls -d /qsys.lib/v4r5m0.lib/QWOBJ*
/qsys.lib/v4r5m0.lib/QWOBJ.FILE

Example 2

This example is similar to the first example except that, in this case, the find utility is doing the comparison, and not the shell.

$ find /qsys.lib/v4r5m0.lib/ -name 'qwobj*' -print

$ find /qsys.lib/v4r5m0.lib/ -name 'QWOBJ*' -print
/qsys.lib/v4r5m0.lib/QWOBJ.FILE

Example 3

The ps utility expects user names to be case-sensitive and therefore does not recognize a match between the uppercase name specified for the -u option and lowercase names returned by the PASE for i runtime function getpwuid():

$ ps -uTIMMS -f
UID PID PPID C STIME TTY TIME CMD
$ ps -utimms -f
UID PID PPID C STIME TTY TIME CMD 
timms 617 570 0 10:54:00 - 0:00 /QOpenSys/usr/bin/-sh -i
timms 660 617 0 11:14:56 - 0:00 ps -utimms -f