Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!homxb!houxm!hropus!ka From: ka@hropus.UUCP Newsgroups: comp.unix.wizards Subject: /dev/stdin: why not call it "-"? Message-ID: <1098@hropus.UUCP> Date: Mon, 15-Jun-87 17:02:01 EDT Article-I.D.: hropus.1098 Posted: Mon Jun 15 17:02:01 1987 Date-Received: Wed, 17-Jun-87 01:48:21 EDT References: <7359@brl-adm.ARPA> <5856@brl-smoke.ARPA> <15318@onfcanim.UUCP> <792@mcgill-vision.UUCP> <7036@mimsy.UUCP> Organization: Bell Labs, Holmdel, NJ Lines: 22 "-" is certainly easier to type than "/dev/stdin" and is already somewhat of a UN*X convention. How do you implement it? Change the name of "open" to "_open" and add the following subroutine to your library: int open(file, mode, cmode) char *file; { if (strcmp(file, "-") == 0 && (mode & 03) == 0) return dup(0); else return _open(file, mode, cmode); } Of course this requires that your programs be recompiled if you don't have shared libraries, but it's a lot cleaner than mucking around with file descriptors from within a device driver. Even if you want a kernel solution and prefer the name "/dev/stdin" I would still be inclined to stick a check in nami rather than using a device driver, just as a matter of style. Kenneth Almquist