Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!uakari.primate.wisc.edu!aplcen!haven!mimsy!chris
From: chris@mimsy.UUCP (Chris Torek)
Newsgroups: comp.std.c
Subject: Re: Portability
Keywords: PORTABILITY
Message-ID: <19495@mimsy.UUCP>
Date: 9 Sep 89 15:22:26 GMT
References: <116@quame.UUCP>
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 33

In article <116@quame.UUCP> bryan@quame.UUCP (Bryan A. Woodruff) writes:
>... When C was designed, was it not the idea to have a completely
>portable language from system to system?

No, actually, the idea was to rewrite the Unix system, which until
then had been written largely in assembly, in a higher level language
so that Ken Thompson could get back to working on his chess game. :-)

>Do not all systems have a tree directory or some other directory structure?

Nope.  Take a look at a TRS-80 model I with 48 kB and a cassette
recorder.  There exist C compilers that would fit on this machine.  It
has no directories.

>Why then are there not portable functions for accessing the directories?

You have just answered your own question.

More seriously, directories on some systems (the Univac comes to
mind, as does IBM's CMS) are very weird entities with so many special
cases that a general `directory access' or `file tree walk' (such
as readdir() and scandir() and, in 4.4BSD, ftw()) would be largely
useless anyway.

>When is C going to be completely portable, without having to worry about
>#IFDEF's????

Never.  No language is completely portable (just try running *ANYTHING*
on a FooBletch Mark 6-and-a-half :-) ).  In particular, language
standards are not good places to hide operating system standards.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris