Portability

Chris Torek chris at mimsy.UUCP
Sun Sep 10 01:22:26 AEST 1989


In article <116 at quame.UUCP> bryan at 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 at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.std.c mailing list