Case insensitive UNIX = Mac OS X
Saturday, 13. September 2008, 00:20:00
I was more than frustrated after losing my 2 partitions. I can't blame any of the operating systems I was using (FreeBSD and Windows XP) because I played a lot with file system layout on my disks. Eventually, I lost 2 of them - no recovery. Roughly 1.2GB code (bitmap and other resources, too) vaporized. At that moment, a lightning struck; "I need a problem-less machine - a Mac!". So, thanks to Faisal, he helped me carrying Mac to my apartment. I booted and and played... After a very long time, I installed a few things. Sometime later, I tried following in Terminal:
head somefile
guess what happened? It ran LWP's HEAD. HEAD is supposed to retrieve HTTP header for given URL. It has absolutely nothing to do with what I wanted. I was baffled! Quick Google search returned results; "because Mac OS X is (by default) case InSeNsItIvE, it executes HEAD instead of head". WTF? Solution?
sudo mv /usr/bin/HEAD /usr/bin/HEAD_LWP
Today, something else went wrong, too!
I was compiling (well, "porting", literally) this fancy OpenGL shadow map sample. Author - though permitted by the standard and seems perfectly OK - used:
#include "Math.h"
Looks innocent:
- It's inside double quotes, meaning that "search this header file under user specified directories first".
- It begins with CAPITAL 'M', not with 'm'.
Actual Result: gcc4.2 (or Xcode build system) thinks:
#include "Math.h"
is identical to:
#include <math.h>
(Today, I updated to Xcode 3.1 - by the way, FINALLY we can use Open MP under Mac OS X with a "free" compiler now! Good morning Apple!)
Mind slappingly, CoreServices/CoreServices.h failed to compile! Dude, that's a system header file, independent from anything I write (in theory). But that header file, somewhere (it's a deep hierarchy) does #include <math.h> in <fp.h>. However, gcc takes the one in my folder, despite the fact that my file begins with CAPITAL 'M' and is inside double quotes.
Best solution: If you are developer, find a way to convert your file system to CaSe SeNsItIvE! I don't understand why would somebody use a UNIX with a case insensitive file system! Backwards compatibility? Poor programmers? WTF?





