Hi all,
I am sure I am missing something really obvious here BUT..
I want to open file using CreateFile.
If it does not exist I want to create it and write to it...
If it already exists, I want to append to it.
To this end, I used
CreateFile(path,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ,NULL,OPEN_ALWAYS,0,NULL);
(path is a variable name in my program).
This works the first time ie it creates the file but when I exit the application and then go back in again the CreateFile statement seems to wipe hte file contents....I NEED to append !!!
What should I be doing?
I can't find any previous threads on this one but I am sure I am not the first person who wanted to run this scenario ???
I am sure I am missing something really obvious here BUT..
I want to open file using CreateFile.
If it does not exist I want to create it and write to it...
If it already exists, I want to append to it.
To this end, I used
CreateFile(path,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ,NULL,OPEN_ALWAYS,0,NULL);
(path is a variable name in my program).
This works the first time ie it creates the file but when I exit the application and then go back in again the CreateFile statement seems to wipe hte file contents....I NEED to append !!!
What should I be doing?
I can't find any previous threads on this one but I am sure I am not the first person who wanted to run this scenario ???