🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3193

Re: Turbo C++ fopen() & fflush()

#3193
From: Doug Dougherty
Date: Mon, 26 Nov 1990 16:31
28 lines
1096 bytes
emmo@moncam.co.uk (Dave Emmerson) writes:

>Heh, I got burned by that one too.

>Problem is, fflush doesn't flush the DOS buffers to disk, so
>you need to do :

>FILE *stream ;
>int fhandle ;

>....

>fflush(stream) ;
>fhandle = dup(fileno(stream)) ;
>close(fhandle) ;

>....

>Its messy, but it'll fix it for you. Note that stream remains 
>open, but the buffers have been flushed, and the FAT updated.


>ATB,

>Dave E.

Incidentally, there is a "Commit File" system call in DOS 3.3+
Supposed to be the bestest, fastest way to do it.
Technical Details
Message-ID: <valley.659637095@gsbsun>
Path: arc1-ca.pugleaf.net!utzoo!attcan!telly!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!ncar!midway!valley
References: <1778@mts.ucs.UAlberta.CA> <1020@marvin.moncam.co.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!telly!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!ncar!midway!valley
From: valley@uchicago (Doug Dougherty)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Turbo C++ fopen() & fflush()
Message-ID: <valley.659637095@gsbsun>
Date: 26 Nov 90 16:31:35 GMT
References: <1778@mts.ucs.UAlberta.CA> <1020@marvin.moncam.co.uk>
Sender: news@midway.uchicago.edu (News Administrator)
Organization: University of Chicago
Lines: 28