Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How can I write data to the file?

I would like to know how can I continue writting data to the file. Which function that I can use? I try to use WriteFile(), and it works correctly but it keeps writting over the old data. I want to keep writing line by line.

I just move from console to win32, because if it's in console I can just use fstream functions, but I'm interested to learn win32. Thanks in advance.

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : I would like to know how can I continue writting data to the file.
    : Which function that I can use? I try to use WriteFile(), and it
    : works correctly but it keeps writting over the old data. I want to
    : keep writing line by line.
    :
    : I just move from console to win32, because if it's in console I can
    : just use fstream functions, but I'm interested to learn win32.
    : Thanks in advance.
    :
    [color=Blue]Use SetFilePointer() to set the file pointer at the end of file and then use WriteFile(). this should append the lines to the ones already in the file.[/color]
  • silentHillsilentHill Member Posts: 4
    : : I would like to know how can I continue writting data to the file.
    : : Which function that I can use? I try to use WriteFile(), and it
    : : works correctly but it keeps writting over the old data. I want to
    : : keep writing line by line.
    : :
    : : I just move from console to win32, because if it's in console I can
    : : just use fstream functions, but I'm interested to learn win32.
    : : Thanks in advance.
    : :
    : [color=Blue]Use SetFilePointer() to set the file pointer at the end
    : of file and then use WriteFile(). this should append the lines to
    : the ones already in the file.[/color]

    thank you for your reply. I followed your suggestion and it works like a charm, thanks a bunch.

Sign In or Register to comment.