CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Posts
    1,689

    Forcing a file to write?

    I've got a FILE in a dll that is supposed to be a log of everything that happens. The problem is that none of the writes commit until I close the file. Is there a way to get the writes to commit immediately?

  2. #2
    Join Date
    Feb 2005
    Posts
    2,160

    Re: Forcing a file to write?

    fflush();

  3. #3
    Join Date
    Jul 2002
    Location
    Seattle Area, WA
    Posts
    241

    Re: Forcing a file to write?

    How are you writing the file?

    CFile? CArchive? Most write type functions have a flush() method that commits outstanding writes.

  4. #4
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,721

    Re: Forcing a file to write?

    I would guess : the fflush function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured