
Using open and then LockFile for a file
comp.lang.c++:
Quote:
> Hi all,
> I'm porting a Unix application to Windows. Im using M$ VC++ compiler.
> My problem is that on Unix the file locking mechanism is done using
> the fcntl() function that doesn't exist on Windows. I know that on
> Windows I can do this using CreateFile() to get the HANDLE to a file
> and then this handle can be used in LockFile() for locking the file.
> But, I would like to open the file using open() function, which
> returns an "int" and then for using the LockFile() I need a HANDLE to
> the file, so my question is: is there a function that can transform
> the "int" returned by open() into a HANDLE that then can be used in
> LockFile() ?
> Thanks in advance,
> vc
Please don't post non-standard stuff like this to comp.lang.c++ in the
future. If it is not part of the C++ language, as defined by the ISO
standard, it is off-topic here.
--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq