From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/4398 Path: main.gmane.org!not-for-mail From: Ed L Cashin Newsgroups: gmane.comp.tex.context Subject: Re: metapost not invoked? mpgraph.1 not created Date: 15 Mar 2001 14:45:12 -0500 Sender: owner-ntg-context@let.uu.nl Message-ID: References: <3.0.6.32.20010220125344.01cc87b0@server-1> <3.0.6.32.20010220174002.00afa980@server-1> <86elvzp9t7.fsf@office.admaster.pl> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035395069 25452 80.91.224.250 (23 Oct 2002 17:44:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 17:44:29 +0000 (UTC) Cc: Hans Hagen , Marc van Dongen , Patrick Gundlach , ConTeXt Original-To: Slawek Zak In-Reply-To: <86elvzp9t7.fsf@office.admaster.pl> Xref: main.gmane.org gmane.comp.tex.context:4398 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:4398 Slawek Zak writes: ... > Which makes perl try to run the script on UNIX systems without > checking if it's executable (texutil was -x in my case) and, which is > more problematic, doesn't check for possible execution errors. I've > proposed some time ago to change the call to something like: > > ... > if (! -x $ScriptName) { > die("Nonexecutable script, fix the permisions for $ScriptName\n"); > } else { > system ("$ScriptName $Options") or die $!; > } > ... > > What do you think? I think it's not necessary to be that specific, since perl knows what the last error was (it's in the $! variable), and you're limiting yourself to just one error. If the $ScriptName wasn't there at all, for example, your error message would be misleading. Instead, let things take care of themselves: $ cp /bin/ls . $ chmod 644 ls $ perl -e 'die "Error: could not run ls: $!" if system "./ls"' Error: could not run ls: Permission denied at -e line 1. ... and anyone who's familiar with UN*X has seen "Permission denied" when the permission to execute is not set. -- --Ed Cashin PGP public key: ecashin@terry.uga.edu http://www.terry.uga.edu/~ecashin/pgp/