Append to a file

This is a discussion on Append to a file within the Windows Programming forums, part of the Platform Specific Boards category; I have searched MSDN and Google, but I still don't know how to append text to a file in Win32. ...

  1. #1
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342

    Append to a file

    I have searched MSDN and Google, but I still don't know how to append text to a file in Win32. So I have decided to come here, any one know how to do it? Thanks, August.

  2. #2
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    Try SetFilePointer() or SetFilePointerEx().

  3. #3
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    why not use C file manipulation in your Win32 app?
    Code:
    FILE *fileptr;
    char filename[13] = "filename.ext";
    
    fileptr = fopen(filename, "a");
    ...
    fclose(fileptr);
    Registered Linux User #380033. Be counted: http://counter.li.org

  4. #4
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    I'm sorry, but I don't get what willc0de4food is saying.

  5. #5
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    i'm saying that you don't need to use any win32 api functions, you can append to a file using ones declared in the stdio.h header.
    read

    Registered Linux User #380033. Be counted: http://counter.li.org

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-22-2008, 12:19 AM
  2. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 11:12 PM
  3. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 10:57 AM
  4. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21