Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!rutgers!njin!princeton!twg.com!david From: david@twg.com (David S. Herron) Newsgroups: comp.sys.amiga.advocacy Subject: Re: Script bits Message-ID: <8660@gollum.twg.com> Date: 19 Feb 91 01:29:40 GMT References: <18ac1a05.ARN2ae4@prolix.pub.uu.oz.au> Organization: The Wollongong Group, Palo Alto, CA Lines: 56 In article <18ac1a05.ARN2ae4@prolix.pub.uu.oz.au> dac@prolix.pub.uu.oz.au writes: >In article <1991Feb11.113601.1338@sugar.hackercorp.com>, Peter da Silva writes: > >> > In article <1991Feb9.045752.2018@sugar.hackercorp.com>, Peter da Silva writes: >> > > In any case, adding a special bit for *each* separate command language is a >> > > bad idea. I think the script bit is a mistake already. ... >> 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. The 'Script' bit is great. Whilst >having the machine check to see if a file is a script, is plain dumb. There is >no reason why a binary should start with any particular sequence of >characters, right? Therefore, there is no reason why some unlucky binary file >could start with the text '.key', and then the script interpreter would be >called instead of the program loader - which would try to 'execute' a binary. >Not clever at all. > >Adding the overhead of having to parse any executable to see if it's a script >is not clever, and I agree with CBM's decision to make a script-bit. Oops.. just realized my post earlier was incomplete. There is very little "parsing" to do to recognize what kind of executable you have there. At least on Unix what is done is make the first 2 (4?) bytes be a "magic number". For an executable script the magic number is "#!" and for normal object files the magic number is something that cannot appear in normal text. Hmm.. this assumption will likely break soon since Unix is being internationalized, part of which is support for 8-bit text. Sigh.. Yeah, sure, I'm being inflamatory by saying "Unix does this already" .. but, really, the capabilities are there and would be a useful addition to AmigaDOS. For instance Unix has different sorts of "object files" with different capabilities -- simply by using different Magic Numbers. Using a Unix-y magic number scheme the "pure" bit in the protection is not necessary, it would just be a different magic number. After all, what does the purity of the program have to do with file protections? Methinks it was just a handy place to stuff a bit without having to change too many things. (quick hack) If you wanna do a one-up-manship with Unix then I suggest putting the Magic Number some other place besides the beginning of the file. David -- <- David Herron, an MMDF & WIN/MHS guy, <- Formerly: David Herron -- NonResident E-Mail Hack <- <- MS-DOS ... The ultimate computer virus.