Re: path names with spaces
Re: path names with spaces
- Subject: Re: path names with spaces
- From: Markus Hitter <email@hidden>
- Date: Thu, 17 Jan 2002 12:08:24 +0100
Am Donnerstag den, 17. Januar 2002, um 02:01, schrieb Andreas Wolf:
I ran into weird situations when trying to popen() a path that
was retrieved with -(NSString*) pathForResource:ofType because the path
name for that resource contains a space character. The shell
that gets invoked
implicitly interprets the space as a delimiter for the path.
Try to put the name into single or double quotes. Should be
easier than adding backslashes.
Like:
NSString *path;
unsigned char *tempStr;
FILE *myPipe;
...
sprintf(tempStr, "cat \"%s\"", [path cString]);
myPipe = popen(tempStr, "r");
if (myPipe) ...
Have fun,
Markus
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/