Re: Integrating Unix scripting in Cocoa app
Re: Integrating Unix scripting in Cocoa app
- Subject: Re: Integrating Unix scripting in Cocoa app
- From: Kevin Kuehl <email@hidden>
- Date: Wed, 8 Aug 2007 10:02:08 -0700 (PDT)
--- Ron Fleckner <email@hidden> wrote:
> So I may have
> caveats such as "You can put any shell script into
> the Scripts folder
> for inclusion in the Scripts menu as long as it is
> executable and has
> the appropriate file extension." or some such rule.
I would suggest if you are going to place any caveats,
they should be the script must use the '#!' properly
and have its executable bit(s) set. Those have been
the only right way to treat scripts (be they Bourne,
csh, perl, Python, etc.) as executables under UNIX for
at least two decades. I would even go so far as to
throw overboard the old assumption that scripts not
including the '#!' are Bourne shell scripts. That too
has been bad practice for at least 20 years and you
shouldn't be forced to support that kind of legacy.
File name extensions are meaningless in UNIX and
something Apple grafted onto the Finder simply to make
the transition away from Windows easier. None of the
underlying UNIX infrastructure cares about or uses
filename extensions. If a user properly configures
the '#!' in a Python script, they shouldn't also be
forced to end it in a .py if they don't want to do so.
On the other hand, your software shouldn't be forced
to search around for the correct Python interpretor to
use if the user won't put in the '#!' and insist that
any file ending in .py is a Python script.
Kevin Kuehl
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden