Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Oct 1997 20:45:01 -0500 (EST)
From:      Alfred Perlstein <perlsta@cs.sunyit.edu>
To:        hackers@FreeBSD.org
Subject:   help with fstat?
Message-ID:  <Pine.BSF.3.96.971026203728.19711A-100000@server.local.sunyit.edu>

next in thread | raw e-mail | index | archive | help

i'm trying to write a program that will dump a file through a TCP
connection, i've decided to use fstat() to get the optimum tranfer info...

however i'm very confused as to what it reports, the man page says:

  st_blksize     The optimal I/O block size for the file.

  st_blocks      The actual number of blocks allocated for the file in
                 512-byte units.  As short symbolic links are stored in  the
                 inode, this number may be zero.

i want to run a loop doing reads from the file into a buffer of optimal
size...

how should i derive the size optimal amount of bytes from this?

is seems fstat always returns the same amount of blocks for the two
values no matter how big the file is it always reports that i should grab
the whole file...

is there a better way to get this info? or am i interpreting the data
incorrectly?

another problem i'm having is figuring out how to manipulate the data type
"quad_t"

can someone point me to where it is defined? i know it represents an 8
byte integer right? but how can i move it around correctly and use it?

-Alfred




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.971026203728.19711A-100000>