Re: avoid space in path names
Re: avoid space in path names
- Subject: Re: avoid space in path names
- From: Scott Fraser <email@hidden>
- Date: Mon, 19 Dec 2005 10:50:48 -0800
On Dec 13, 2005, at 09:23 PM, email@hidden wrote:
Just as a heads up: try to avoid spaces in your paths and
configuration names. I know it may be awkward having to do this on a
Mac in 2005, but the gods of Unix demand it. I just stumbled over
another case where Xcode 2.2 refused to build because I had a space
in the name of my hard drive (bug has been filed, #4377118). So, save
yourself some headaches and avoid any spaces in paths in the post-
FSSpec world.
I have all sorts of spaces and odd characters in my path names, and Xcode 2.0, 2.1, and 2.2 have all worked just fine.
What hasn't been mentioned here is that any IDE, compiler, or linker variable that is likely to contain a path name should always be quoted, especially any build variable that can contain a space-separated list of path names. In particular, the "XXX Search Paths" variables all need quoted path names. In the "Target YYY Info" settings dialog, the "Header Search Paths", "User Header ...", "Library ...", "Framework ...", and "Rez Search Paths" variables all benefit from quoting any path names, even if there is only a single path name.
For example, my "Library Search Paths" variable is set to
"$(TARGET_BUILD_DIR)/../../Other Libraries Dir" (including the double quotes). Without the double quotes, the build fails.
This may be unrelated, but I've noticed that it helps to define the "Path Type" of all source files as "Relative to Project" (file "Get Info", tab: "General", "Path Type" pop-up set to "Relative to Project"). This seems to reduce many build-location-specific problems, because you have more control over the names of paths inside your Project structure, than you do over the names of the disks on which the build is made.
As in any Unix environment (not just Mac OSX), Unix is perfectly happy with spaces in path names. Problems arise when script writers fail to account for such spaces. MPW scripting was the same way. Whenever you have a variable that might contain a path name, always, always quote the variable reference. In fact, just get in the habit of quoting
all script variables. It seldom hurts, and it protects you from those gall durn $%^$* users who insist on giving their folders "natural" names. :-)
Scott
-----
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden