Re: File IO related issue by hangaround
hangaround
Sat Jul 21 23:32:02 CDT 2007
"Igor Tandetnik" wrote:
> "hangaround" <hangaround@discussions.microsoft.com> wrote in message
> news:90AF9B3F-D792-41F5-A92D-1E8335532953@microsoft.com
> > for example, when I Open a file (using CreateFile or other APIs), I
> > could know the file is being write(using WriteFile) by other thread.
>
> Don't pass FILE_SHARE_WRITE flag in dwShareMode parameter. Then
> CreateFile will fail if the file is already opened for writing.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
>
>
If I use CloseHandle to the file , which is using by WriteFile by other
thread, then what will happen?