|
-
January 6th, 2009, 04:18 PM
#1
[RESOLVED] Adding data to file with CreateFile()
i want to add some data to a txt file and i use CreateFile() and OPEN_EXISTING to do so
but it will add the data at the beginning of the file , i want to add the data do the end of the file
how can i do that with CreateFile()? or i cant ? any alternative ways to add data at the end of file?
heres my code
Code:
hFile = CreateFile(_T("C:\\test.txt"),GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
WriteFile(hFile, lpFile_Data, dwFileSize , &dwBytesWritten, NULL);
-
January 6th, 2009, 04:38 PM
#2
Re: Adding data to file with CreateFile()
See the example from this article, in the community content section.
http://msdn.microsoft.com/en-us/libr...47(VS.85).aspx
Regards
-
January 6th, 2009, 05:12 PM
#3
Re: Adding data to file with CreateFile()
thank you , exactly what i needed!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|