Walter Roberson wrote:
....
Unfortunately your answer to this off-topic question was not correct.
POSIX, for example, defines most attributes as being related to
the file descriptor (fd), not the file handle (FILE*) --
but when it comes to POSIX locking:
What is a "file handle" ? That is also platform specific and somewhat a
generic term. The C stdio FILE* is not generally considered a file
handle and as you point out, the term "file descriptor" is in general
related to lower level I/O facilities in *NIX. Handles are however
related to win32 file I/O.
You will find much documentation refer to file descriptors as file
handles, but as you pointed out, file descriptors can refer to the same
instance of an open file (because of dup and dup2) and so it's a little
less useful.
....
Correct locking is platform specific, and needs to be referred to
a platform specific newsgroup.
So, yes, we're off topic, however, it's always good to let the OP know
why it's off topic in a more specific way.
The biggest incompatability however with file locking between *nix and
win32 is that overlapped locks in *nix are combined while on win32 they
are not. This means if you want your code to be portable, don't overlap
your locks.