Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!caen!zaphod.mps.ohio-state.edu!lavaca.uh.edu!menudo.uh.edu!lobster!sugar!peter From: peter@sugar.hackercorp.com (Peter da Silva) Newsgroups: comp.sys.amiga.advocacy Subject: Re: Script bits Message-ID: <1991Feb13.013917.22130@sugar.hackercorp.com> Date: 13 Feb 91 01:39:17 GMT References: <18ac1a05.ARN2ae4@prolix.pub.uu.oz.au> Organization: Sugar Land Unix -- Houston, TX Lines: 38 In article <18ac1a05.ARN2ae4@prolix.pub.uu.oz.au> dac@prolix.pub.uu.oz.au writes: > > There's already an "execute" bit. A file with the execute bit set but not in > > Amiga load format should be treated as a script. > Having eight bits is kinda useful, Peter. UNIX has 16 and they've run out long ago. Sure it uses 9 instead of 4 on protection, but that leaves them an extra 3 bits... and they don't even have an archive bit! > The 'Script' bit is great. Whilst > having the machine check to see if a file is a script, is plain dumb. Why? > There is > no reason why a binary should start with any particular sequence of > characters, right? Sure there is. Observe: 1.System2.0:S> list dterm.init Directory "System2.0:S" on Tuesday 12-Feb-91 dterm.init 5421 ----rwed 25-Dec-90 09:07:26 1 file - 12 blocks used 1.System2.0:S> dterm.init dterm.init: file is not executable 1.System2.0:S> The exact same trick the UNIX shell does would serve: try to execute it as an executable, and if that fails it's a script: segList = LoadSeg(...); if(segList == INVALID) load_script(...); -- Peter da Silva. `-_-' .