Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!think.com!mintaka!geech.ai.mit.edu!rjc From: rjc@geech.ai.mit.edu (Ray Cromwell) Newsgroups: comp.sys.amiga.advocacy Subject: Re: Script bits Message-ID: <1991Feb13.053854.12419@mintaka.lcs.mit.edu> Date: 13 Feb 91 05:38:54 GMT References: <18ac1a05.ARN2ae4@prolix.pub.uu.oz.au> <1991Feb13.013917.22130@sugar.hackercorp.com> Sender: daemon@mintaka.lcs.mit.edu (Lucifer Maleficius) Organization: None Lines: 64 In article <1991Feb13.013917.22130@sugar.hackercorp.com> peter@sugar.hackercorp.com (Peter da Silva) writes: >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! I can think of one reason for the script bit. A directly list. It's neat if I can type ls -F, and the listing will show which files are executable, links, directories, data, and script. I'm afriad open()ing or LoadSeg()ing every file in a tree will be quite slow. >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> Hey, you use dterm? I think matt dillion stopped working on that a long time ago? My version is buggy! (GURUs often) >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(...); if(not_a_script) WhatIsIt(); How do we tell the difference between Arexx scripts, shell scripts, CSH scripts, TCL scripts, etc? What we really need is a new hunk, or recognition sequence that defines that type the file is. (IFF, Text, arexx, ect) Simular to what Commodore did with $VER:. Why? I think it would be neat if the shell could help the user more like 'File is Text, not a script, want to read it? ' Either that, or provide .info files for text and script files. The shell could try to look at the tool (Amigabasic, execute, rx, TCL, Csh, WSH, etc) and execute the the appropriate interpreter that way. I agree that adding bits for every new script language is not the answer. I kind of like the .info scheme since it doesn't require any change to the OS, just the shell. One problem is people don't supply <>.info files for every file on the disk. Editors and Applications have to be smarter and start to save icon files out too. Now that Workbench is actually USUABLE, I hope more 2.0 programs do this. It's a pain to use Iconedit, or duplicate an icon everytime you want to use it from workbench. So what do you think? Should shells check the .info file of a file and look at the default tool so it knows which interpreter to use? >-- >Peter da Silva. `-_-' >.