file descriptor vs file handle

uunet!bria!mike uunet!bria!mike
Thu Feb 28 08:24:46 AEST 1991


Egads!  Such a difference in opinion over such a simple little thing.
Tis truly amazing.  Anyhow, from the traditional school of thought:

	1.  When one refers to "handles" and "descriptors" in the classic
	    sense, you are talking about the *same* thing: a non-negative
	    integer that is an index into a table of open files local to
            the process (children may inherit descriptors from their
	    parent upon their creation; its up to the parent process to
	    decide this.)  Various implementations of an operating system
            may change this.  Not all operating systems grok this.
            This is system dependant, and could be a Bad Thing if you are
            worried about portability to "strange" operating systems.

	2.  The pointer that is returned by fopen() is a file _stream_
	    pointer.  Not handle.  Not descriptor.  Not R4 STREAM either.
	    Stream.  The whole point there was to isolate the programmer
            from some of the dependancies of the underlying OS. 

As a point of honour:

        The concept of the file descriptor did NOT originate with that
        black sheep known as DOS, nor that vile program loader known as
        CP/M.  It probably predates UNIX (circa 1969).

-- 
Michael Stefanik, MGI Inc., Los Angeles| Opinions stated are not even my own.
Title of the week: Systems Engineer    | UUCP: ...!uunet!bria!mike
-------------------------------------------------------------------------------
Remember folks: If you can't flame MS-DOS, then what _can_ you flame?



More information about the Comp.lang.c mailing list