Hi,

I tried to use the following call to open a file (and to be able to continue
my writing to it):

status = ZwCreateFile(&hfile,GENERIC_WRITE | FILE_APPEND_DATA, &oa,
&iostatus, NULL,FILE_ATTRIBUTE_NORMAL,FILE_SHARE_READ |
FILE_SHARE_DELETE,FILE_OPEN,FILE_SYNCHRONOUS_IO_NONALERT,NULL,0);

Unfortunately, if the file already exists hfile remains invalid. Can't I
open a file that way?

Thanks
Peter

Re: Writing to file by cristalink

cristalink
Sun Mar 20 13:05:04 CST 2005

Yes you can.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/kmarch/hh/kmarch/k111_80b1882a-8617-45d4-a783-dbc3bfc9aad4.xml.asp

--
http://www.firestreamer.com - NTBackup to DVD and DV


"Peter Schmitz" <PeterSchmitz@discussions.microsoft.com> wrote in message
news:C222653C-B9B5-4E6E-A77A-14932B353F3D@microsoft.com...
> Hi,
>
> I tried to use the following call to open a file (and to be able to
continue
> my writing to it):
>
> status = ZwCreateFile(&hfile,GENERIC_WRITE | FILE_APPEND_DATA, &oa,
> &iostatus, NULL,FILE_ATTRIBUTE_NORMAL,FILE_SHARE_READ |
> FILE_SHARE_DELETE,FILE_OPEN,FILE_SYNCHRONOUS_IO_NONALERT,NULL,0);
>
> Unfortunately, if the file already exists hfile remains invalid. Can't I
> open a file that way?
>
> Thanks
> Peter