File Flush

This is a discussion on File Flush within the C Programming forums, part of the General Programming Boards category; Hello everyone, Can somebody tell me if there is a function or a way to flush a buffer to a ...

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    184

    File Flush

    Hello everyone,

    Can somebody tell me if there is a function or a way to flush a buffer to a file, using a file descriptor instead of a stream. I know that it can be done using fflush() with a stream, but we have a program that is using sopen with the files and therefore using file descriptors. We would like to flush a buffer to that file. Any suggestions????????????

    Thanks,
    Kendal

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Check your compilers documentation. Post your compilers details here if you don't get anywhere.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Obsessed with C chrismiceli's Avatar
    Join Date
    Jan 2003
    Posts
    501
    i though interger file descriptors were unbuffered, I never worked with sopen though.

  4. #4
    Registered User
    Join Date
    Feb 2003
    Posts
    184
    I am sorry. I usually post all of my details. I forgot this time. We are using DevC++ which, if I am correct, uses the MingW gcc3.2 compiler. So far from looking I have found nothing. I figured that if a function exists out there, somebody on this forum might know. I appreciate all the help that is provided here.

    Thanks again,
    Kendal

  5. #5
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Maybe you can use fdopen to open a stream on the descriptor, then flush that instead.

    Or maybe you have sync or fsync at your disposal.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  3. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM
  4. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 01:58 AM

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