Path: utzoo!attcan!uunet!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: file descriptor vs file handle Message-ID: <4846@goanna.cs.rmit.oz.au> Date: 28 Feb 91 02:34:18 GMT References: <90361.145855COS99291@ufrj.bitnet> <1021@uncw.UUCP> <4842@goanna.cs.rmit.oz.au> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 18 In article <4842@goanna.cs.rmit.oz.au>, ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes: > > cwong@charlie.coyote.trw.com (Chun Wong) writes: > > >Can someone distinguish the differences between a file descriptor and > > >a file handle? I know that creat returns a file handle whereas fopen > > >returns a file descriptor. What's the difference? Are they interchangeable? I explained file-descriptor, path-name, and stdio-stream. I forgot to say anything about "handle". OS/2 documentation uses the word "handle" to mean exactly the same thing as UNIX means by "file descriptor". For example, the thing DosOpen() returns via its second argument is a "handle", which is a 16-bit integer, just as open() in UNIX returns an integer. In fact, just as standard input, output, and error have file descriptors 0, 1, and 2 in UNIX, so STDIN, STDOUT, and STDERR are 0, 1, and 2 in OS/2. "Handle" is used in other environments to mean a pointer to a pointer. You Have Been Warned. -- The purpose of advertising is to destroy the freedom of the market.