Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questions about launchd




On Aug 25, 2007, at 11:41 AM, Finlay Dobbie wrote:

Yes, but we were discussing the fragility of parsing tool output.

OK, well, that's an easy discussion: Don't do that.

If that's too terse of an answer, here's a little example Q&A session that elaborates:

Q) What if I really want to parse command line output?
A) I don't care.  Don't do that.

Q) But... Parsing command output is easier than writing C code which does the same thing through API calls! What do you say to that?
A) Don't do that.


Q) Isn't there some sort of tacit agreement to keep command-line output formats the same forever, as God and Dennis Ritchie intended?
A) No. Don't do that.


Q) What if I'm one of those scripting types who believes that compilers are an abomination? Can I parse command-line output then?
A) No. Don't do that. Use Ruby, Python or Perl and some of the fine API shims they provide for doing such things.


Q) Aren't you being just a tad inflexible about all of this?
A) Yes, but you still shouldn't do that. We reserve the right to change command-line output at any time (sometimes it's not even us, but our upstream OSS providers) and when your scripts break, we'll both be sad and wishing you'd followed the advice in this Q&A.



_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >Questions about launchd (From: Michal Taurich <email@hidden>)
 >Re: Questions about launchd (From: Dave Zarzycki <email@hidden>)
 >Re: Questions about launchd (From: Terry Lambert <email@hidden>)
 >Re: Questions about launchd (From: "Finlay Dobbie" <email@hidden>)
 >Re: Questions about launchd (From: Terry Lambert <email@hidden>)
 >Re: Questions about launchd (From: "Finlay Dobbie" <email@hidden>)
 >Re: Questions about launchd (From: "Jordan K. Hubbard" <email@hidden>)
 >Re: Questions about launchd (From: "Finlay Dobbie" <email@hidden>)
 >Re: Questions about launchd (From: "Jordan K. Hubbard" <email@hidden>)
 >Re: Questions about launchd (From: "Finlay Dobbie" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.