Hi all
When opening a file like ->
invoke CreateFile,ADDR fileName,GENERIC_WRITE,NULL,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL
invoke WriteFile,[hLogger],ADDR pText,eax,ADDR numBytes,NULL
is there any way to append the file when it is open for a second time?
I have looked throught MSDN and google to find a simple solution but most the time examples use fopen and other starndard c stuff.
Any help is appreciated?
Cheers Adam
SetFilePointer?
Yeah if you know how far to move the pointer then you can use SetFilePointer or _lseek I believe and get to the end of the file, so the next write will append to it.
Cheers
that give me another avenue to chase down!
Thanks Adam
And MSDN gave me the rest!
invoke CreateFile,ADDR fileName,GENERIC_WRITE,NULL,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL
invoke SetFilePointer,[hLogger],0,NULL, FILE_END
invoke WriteFile,[hLogger],ADDR pText,eax,ADDR numBytes,NULL
for peoples future reference!
This is what I meant.
SetFilePointer allows you to move to the end anyway (without you needing to know where that is) ::)
And if not, you could get the file's size :bdg
Anyway, problem solved :U