|
From: alladyn on 29 Aug 2005 03:06 Hello, I just found out that file is not locked if I use that file attributes FILE_SHARE_READ and FILE_SHARE_WRITE. Does it mean that I don't have to use synchronization mechanizm for reading and writing and system will take care of that? thanks CreateFile(lpszFileName, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
From: David Lowndes on 29 Aug 2005 05:33 >Hello, I just found out that file is not locked if I use that file >attributes FILE_SHARE_READ and FILE_SHARE_WRITE. Does it mean that I don't >have to use synchronization mechanizm for reading and writing and system >will take care of that? Can you explain what synchronisation you think this facility may provide you? While each process will be able to read and write to the file, it's still up to your processes to behave in a cooperative manner with regards to the contents of the file. Dave -- MVP VC++ FAQ: http://www.mvps.org/vcfaq
From: alladyn on 29 Aug 2005 11:54 Actually I found out too, that when moving File Poniter I have to use synchronization, system doesn't help here. But when just reading no need to. thanks "David Lowndes" <davidl(a)example.invalid> wrote in message news:9cl5h11at51h6qhv4bl6tanjv2measjkbi(a)4ax.com... > >Hello, I just found out that file is not locked if I use that file >>attributes FILE_SHARE_READ and FILE_SHARE_WRITE. Does it mean that I >>don't >>have to use synchronization mechanizm for reading and writing and system >>will take care of that? > > Can you explain what synchronisation you think this facility may > provide you? > > While each process will be able to read and write to the file, it's > still up to your processes to behave in a cooperative manner with > regards to the contents of the file. > > Dave > -- > MVP VC++ FAQ: http://www.mvps.org/vcfaq
|
Pages: 1 Prev: FindFirstFile Next: LINK : warning LNK4089: all references to "SHELL32.dll" discarded |