Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!clyde.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!wuarchive!psuvax1!psuvm!blekul11!ghgaqz4 From: GHGAQZ4@cc1.kuleuven.ac.be Newsgroups: comp.sys.amiga.advocacy Subject: Re: Script bits Message-ID: <91050.162708GHGAQZ4@cc1.kuleuven.ac.be> Date: 19 Feb 91 16:26:08 GMT References: <18ac1a05.ARN2ae4@prolix.pub.uu.oz.au> <8660@gollum.twg.com> Organization: K.U.Leuven - Academic Computing Center Lines: 43 >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 You obviously don't know the Amiga well. Amiga executables are very well recognizable by the first 4 bytes of the file. These 4 bytes are always equal to 0x000003F8 (or something like that). This is a highly unlikely longword for ascii files. I think I'd rather have a pure bit than another keyword in the file to indicate it is pure. With the pure bit you do not have to open the file to see if it is pure. A simple Lock will suffice. Opening a file has much more overhead than locking the file. Having a pure bit means that you can include this bit in the directory listing. If there was a Magic Number IN the file, the directory utility would have to open the file, read some bytes from it and close the file again, and this for EACH file in the directory. Jorrit Tyberghein