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

Date: Wed, 25 May 94 15:22:56 -0400
From: dj AT ctron DOT com (DJ Delorie)
To: ericb AT lsid DOT hp DOT com
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Library problems

> 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.

> 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.


- Raw text -


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