delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/05/25/15:49:51

From: Eric Backus <ericb AT lsid DOT hp DOT com>
Subject: Re: Library problems
To: dj AT ctron DOT com
Date: Wed, 25 May 94 12:29:14 PDT
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)
Mailer: Elm [revision: 70.85]

> > When writing a file to disk, are all 4096 bytes of a "transfer block"
> > always in 8 contiguous "disk blocks"?  If so, then I have no problem
> > with st_blksize getting set to 4096.
> 
> Irrelevent, since we always go through the DOS filesystem calls.
> Nothing in a djgpp application needs to worry about the physical
> layout of a file on disk.

This is true, but the same is true on UNIX.  And yet, there is this
st_blksize field that has to be set to something.  Sounds like 4096 is
a reasonable value for djgpp.

> > I don't recall, and I'm at work now.  Is there an st_blocks field in
> > the stat structure?  If so, I think it should be equal to the number
> > of st_blksize blocks in the file.
> 
> There is an st_size member, but it is in bytes, not blocks.
> <sys/vfs.h> has a statfs structure that returns physical blocksize and
> number of physical blocks on each drive.

So the physical blocksize from statfs would be 512?  I guess this
would be the way to get that, for an application that really cares.
--
				Eric Backus
				ericb AT lsid DOT hp DOT com
				(206) 335-2495

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019