🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #787

Re: winapi WriteFile single byte and buffering

#787
From: Bob Gonder
Date: Thu, 10 Jan 2008 17:08
15 lines
1544 bytes
John Grabner wrote:

>I am using WrtieFile to write a lot of single bytes to a file. Reading 
>the documentation I cannot work out if I can have a buffered write and 
>if so how do to do a buffered write.

I believe Windows defaults to buffered writes.
You can turn +off+ buffered writes with these
two flags when you use CreateFile():
FILE_FLAG_WRITE_THROUGH
FILE_FLAG_NO_BUFFERING
So, in your case, make sure they are off.

In addition, you might want to turn on 
FILE_FLAG_SEQUENTIAL_SCAN
Technical Details
Message-ID: <atjco31cj5bcbogg2mrj4dfjij842s7hpu@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <47859f0a$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,dda6b5e99e5dd7cc
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: winapi WriteFile single byte and buffering
Date: Thu, 10 Jan 2008 09:08:18 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <atjco31cj5bcbogg2mrj4dfjij842s7hpu@4ax.com>
References: <47859f0a$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.77.147.57
X-Trace: newsgroups.borland.com 1199984898 67.77.147.57 (10 Jan 2008 09:08:18 -0700)
Lines: 17
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail