• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using pathnames with special characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >Re: Using pathnames with special characters (From: Chris Ridd <email@hidden>)

  • Prev by Date: Re: eps not drawing properly
  • Next by Date: source for Terminal?
  • Previous by thread: Re: Using pathnames with special characters
  • Next by thread: Re: Using pathnames with special characters
  • Index(es):
    • Date
    • Thread