Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!labrea!aurora!ames!hc!beta!cmcl2!brl-adm!umd5!mimsy!aplcen!jhunix!green!bill From: bill@green.UUCP (Bill Bogstad) Newsgroups: comp.lang.c Subject: Re: why "gmtime" but not "read" and "write"? Message-ID: <478@green.UUCP> Date: Sun, 20-Sep-87 17:57:39 EDT Article-I.D.: green.478 Posted: Sun Sep 20 17:57:39 1987 Date-Received: Thu, 24-Sep-87 00:43:49 EDT References: <706@sugar.UUCP> Reply-To: bill@green.UUCP (Bill Bogstad) Organization: JHU Biophysics Dept., Baltimore, MD Lines: 35 In article <706@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes: >Y'all are missing the point. Why include "gmtime" and "localtime" in Ansi-C >(other than to keep the well known false sense of well-being when trying to >port UNIX programs to non-UNIX systems), but leave read/write/etc out? It >just doesn't seem consistent to me. Since most non-UNIX-based 'C' compilers >in the real world implement read and write and *not* gmtime and localtime, >you don't even have precedent behind you. "Most" systems have some type of real-time clock and it would be nice to be able to access the clock from the C language. Having a standard way to do so would be even nicer. The method chosen has been available in the standard unix environment since at least Version 7. Rhetorical question: What about systems without clocks? Answer: What about systems that don't do I/O? (Making stdio vs read/write a mote point. They just have memory mapped registers.) However, "most" systems do allow I/O. Fopen(), fclose(), etc. are provided as the standard way to access this feature (also since at least Version 7). It has been stated by several people that it is very hard to impossible to fully implement the semantics of read/write on some systems. I do not have personal knowledge of such systems, but I am willing to admit their existence. Should the C language standard require things of these systems (a particular form of I/O) that they are incapable of providing? [If you would like, you may consider the above rationalizations on my part to support an already closed mind. Actually, they probably are. BTW, I would also like read/write to be implemented on any system on which it can be.] Bill Bogstad -- Bill Bogstad bogstad@hopkins-eecs-bravo.arpa Work: (301)338-8019 Home: No way. jhunix!{ green!bill | bph_cwjb } The Johns Hopkins University, Biophysics Department, Baltimore MD 21218