Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site umcp-cs.UUCP Path: utzoo!linus!philabs!seismo!rlgvax!cvl!umcp-cs!israel From: israel@umcp-cs.UUCP Newsgroups: net.cog-eng,net.nlang Subject: Re: expert-friendly: are long names a waste of time? Message-ID: <3976@umcp-cs.UUCP> Date: Mon, 21-Nov-83 17:24:50 EST Article-I.D.: umcp-cs.3976 Posted: Mon Nov 21 17:24:50 1983 Date-Received: Wed, 23-Nov-83 03:23:05 EST References: <4063@amd70.UUCP>, <141@cae780.UUCP> <6125@watmath.UUCP> Organization: Univ. of Maryland, Computer Science Dept. Lines: 39 From: idallen@watmath.UUCP Of course, the idea of "chmod mode file file file mode file file file" can't work, since UNIX files can look just like modes. Even if they didn't look like modes, the argument order problem is still there. Is it chmod mode file file mode file file or chmod file file mode file file mode ? Of course it can work! After all, are the two above cases ambiguous from a human point of view? All you need is a recognition procedure for a validly constructed mode definition, and also a couple of heuristics to use, such as: 1) if it starts with something that could be a mode, it is in mode-first format. 2) if it ends with a mode, then it's in mode-last format. 3) if its in both formats, or neither, then error. 4) if a mode is also the name of a file in the current directory, and could be either a mode or a file (in other words, not in either the first or last position), then ambiguity; print out a message and do something (continue or exit). Note that #4 is a new problem (not currently in 'chmod' now) brought about by the extended paramter parsing. This is equivalent to the problem 'rm' (and other processes) have of files beginning with dashes (i.e. 'rm -f' meaning (to the user) 'rm ./-f'). -- ^-^ Bruce ^-^ University of Maryland, Computer Science {rlgvax,seismo}!umcp-cs!israel (Usenet) israel.umcp-cs@CSNet-Relay (Arpanet)