Re: Using pathnames with special characters
Re: Using pathnames with special characters
- Subject: Re: Using pathnames with special characters
- From: Cryx <email@hidden>
- Date: Thu, 2 May 2002 18:17:03 -0500
On Thursday, May 2, 2002, at 03:25 AM, Chris Ridd wrote:
Cryx <email@hidden> wrote:
On Wednesday, May 1, 2002, at 05:03 AM, Chris Ridd wrote:
If you're using system() then the passed string is interpreted by sh,
and
so you need to look at sh's quoting rules. (Hint: replace \ with \\,
replace " with \" and surround each argument with " characters.)
That's very bad advice, as $'s will still interpolate. If you are ever
tempted to call system or popen -- don't. Always avoid the shell and
use
fork, exec family, and pipes instead.
Rats, forgot about $. Using single quotes would prevent that, but the
better advice is avoid shells getting involved at all. That way there's
nothing to accidentally forget :-)
Except using single quotes is more of a pain since an embedded single
quote can't be easily escaped. It has to be replaced with: '\''. I
think we both agree that the shell should not be used.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.