Path: utzoo!utgpu!watmath!att!pacbell!ames!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!hacgate!tcville!sed170!lee From: lee@sed170.HAC.COM (John Lee) Newsgroups: comp.sys.amiga Subject: Re: Relying on ARP (was Re: My AmigaDOS 1.4 wishlist (one among thousands!)) Message-ID: <309@sed170.HAC.COM> Date: 8 Aug 89 02:00:45 GMT References: <12878@well.UUCP> <26758@agate.BERKELEY.EDU> <20904@cup.portal.com> <26915@agate.BERKELEY.EDU> <11107@polya.Stanford.EDU> Reply-To: lee@sed170.UUCP (John Lee) Distribution: na Organization: Hughes Aircraft Co., El Segundo, CA Lines: 53 In article <11107@polya.Stanford.EDU> rokicki@polya.Stanford.EDU (Tomas G. Rokicki) writes: [...] >I've always wanted to be able to fopen("|lpr", "w"), for instance, to >spool things automatically, or anything else with pipes. Why hasn't >any operating system (that I know of) allowed file names to also specify >new processes? I mean, I can open `par:' or `ser:' or even `speak:'. >Just a thought. [...] Well, I can think of several reasons, not all real justifications, but they're better than "because the system designers/programmers were lazy." :-) First of all, "|lpr" is a legal filename in many filesystems, include UNIX and AmigaDOS. I've used filesnames like that on occasion, or used other funny characters (e.g., "~" or "$") for filenames. Not everybody names their files the same way or for the same reasons. Secondly, redirection operators/symbols are usually in the domain of the shell/user interface, since usually they define the semantics of operation rather than the operating system. Redirection can mean different things depending on the source and/or destination. This is best left up to the shell, although the operating system must have the capabilities or generality to implement various piping/redirection schemes. Remember, even UNIX doesn't have redirection built-in, just a mechanism ("pipes") that shells use to implement redirection. Thirdly, it depends on the design and meaning of "a filename" and the "filespace". In some operating systems, a filename can indeed mean a process. Opening such a "file" actually creates a pipe to and/or from the process like you want. AmigaDos even has little flavor of this, since the filename "CON:100/100/20/50/Test" means open a CON: window of a certain size named "Test". Usually, however, a "filename" is the name of a file on a mass-storage device, and then "|lpr" is inappropriate for a function designed to open a file. It's whatever was decided upon by the designer. Fourthly, there is nothing preventing one from writing a smartopen() which does what you want, depending on the operating system. The resultant code would probably be very similar to that written if it were built into the operating system. Like I said, not exactly concrete reasons. It's more of a stylistic judgement made by the system designers of whether or not the operating system should support redirection directly or to just provide a general mechanism. Personally, I don't think fopen() should support it. --John Lee ------------------------------------------------------------------------------- Raining CATS and DOGS? Join the RATS: Remote Amiga Teleconferencing System +--------+ John Lee | HUGHES | +--------+ ARPAnet: jhlee@hac2arpa.hac.com Hughes Aircraft Company The above opinions are those of the user and not of those of this machine.