Skip navigation.

Sign up | Lost password? | Help

Ambassador

The Royal C++ Embassy

Case insensitive UNIX = Mac OS X

, , , , , , ,

I bought my Mac on a snowy Oslo night. We were in a hury. I didn't have a car and I asked favor of my friend to assist me bring this machine home...

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?

Leopard dual displays = disasterFink, 64-bit, PHP5, Apache2, PostgreSQL, and more stuff

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.

December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31