-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Eric said:
I'm not very familiar with the Windows API's, but it's my belief
that they use the term "handle" for various constructs that manage
files, processes, threads, and whatnot. Is Windows' "file handle"
the same thing as a FILE* or FILE, or does a FILE have a "file handle"
(or reference to same) buried somewhere within it? If the latter (and
again I confess unfamiliarity with the API's), then using the word
"handle" for two different things would be confusing, especially if
one sort of "handle" contains an instance of or reference to the other.
WinAPI has its own functions to manage files. However that's how MSDN
describes handles [1]:
"An application cannot directly access object data or the system
resource that an object represents. Instead, an application must obtain
an object handle, which it can use to examine or modify the system
resource. Each handle has an entry in an internally maintained table.
These entries contain the addresses of the resources and the means to
identify the resource type."
Which perfectly fits FILE definition with one exception, standard don't
mention that each FILE structure/whatever has an entry in an internal table.
However, we know that FILE consist of some kind of file descriptor (in
posix systems it will be just an integer) that is stored in an internal
table, that allows system to associate FILE with file on disk.
Concluding, FILE and handles seems to be very similar and that's why I
think that its not wrong to call FILE "a file handle". On the other
hand, it may be confusing, what that discussion showed very well.
[1]
http://msdn.microsoft.com/en-us/library/ms724457.aspx
Pawel Dziepak
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora -
http://enigmail.mozdev.org
iEYEARECAAYFAkkQgdcACgkQPFW+cUiIHNo26gCdGqlBD3r5KVFFDqfAm7aHkmEK
+zsAnik2/Loe1vvY1Sy14Wc8oDxtESLi
=J4aa
-----END PGP SIGNATURE-----