🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: CreateFile and ReadFile

#11198
From: Andrue Cope
Date: Thu, 19 Feb 2004 17:14
14 lines
1369 bytes
On Fri, 20 Feb 2004 00:42:58 +0800, ray wrote:

> Hi,
> i can use the following code to read a drive, but it just allows me to read
> 512*n bytes (sector size) every time.
> how can i read 1 byte every time?

You can't. Block devices are called block devices because they can only be
read block by block. A block for most hard drives will be 512 sectors. 
Standard practice is to read the entire block then extract the bytes that
you really need.
-- 
Andrue Cope
[Bicester UK]
Technical Details
Message-ID: <ih67f05a4bzf.1w8m6acs1eu0e.dlg@40tude.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4034e792$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,a2e178d9fedcf99e
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-02-19 09:40:26 PST
From: Andrue Cope <no.spam@spammy.com>
Subject: Re: CreateFile and ReadFile
Newsgroups: borland.public.cppbuilder.nativeapi
User-Agent: 40tude_Dialog/2.0.10.1
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
References: <4034e792$1@newsgroups.borland.com>
Date: Thu, 19 Feb 2004 17:14:51 +0000
Message-ID: <ih67f05a4bzf.1w8m6acs1eu0e.dlg@40tude.net>
NNTP-Posting-Host: 217.207.223.34
X-Trace: newsgroups.borland.com 1077210910 217.207.223.34 (19 Feb 2004 09:15:10 -0800)
Lines: 14
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail