TIP: Click on subject to list as thread! ANSI
echo: aust_avtech
to: Niels Petersen
from: Bob Lawrence
date: 1997-01-28 08:22:00
subject: getc()

NP> A file read (at the lowest level) places one sector (512 bytes)
 NP> into a particular place in memory allocated for that purpose.

 > This is what Paul said, but it doesn't work in practice.

 NP> What I wrote is _exactly_ what happens at the machine level
 NP> regardless of what programming language you are using.

  I know all that, but I am not dealing with hardware, Neils, I'm
using C via the CPU.

 NP> I don't understand C, but I think you will find that the buffer
 NP> yo are using in C is NOT the machine area that is set aside as
 NP> per my statement.

  aha! Now you begin to understand the problem.

 NP> IOW it reads a sector from the file regardless of whether your
 NP> program asks for 1 byte or a block.

 > No, it doesn't.

 NP> Why say no it doesn't and then say....

 > What you say is probably true,

  I try to be polite, but I can put it another way if you like...

 NP> Is it clear now :-)

  C (or any other language) lets me use a buffer or not, depending on 
which function I call, and THAT was what I was discussing with Paul. 
It has nothing to do with the way the disc drives move data... this is 
to do with the way the machine accesses that data and puts it in RAM.

  It is possible ot write a low-level handler and take whatever sector 
the drvie reads, or even read a file sector-by-sector, but that is not 
what Paul and I were discussing (if you can call it that). 
 
Regards,
Bob
 
___ Blue Wave/QWK v2.12
@EOT:

---
* Origin: Precision Nonsense, Sydney (3:711/934.12)
SEEN-BY: 711/934 712/610 624
@PATH: 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.