From owner-freebsd-hackers Sun Oct 26 16:40:30 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA00603 for hackers-outgoing; Sun, 26 Oct 1997 16:40:30 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from server.local.sunyit.edu (A-T34.rh.sunyit.edu [150.156.210.241]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA00583 for ; Sun, 26 Oct 1997 16:40:24 -0800 (PST) (envelope-from perlsta@cs.sunyit.edu) Received: from localhost (perlsta@localhost) by server.local.sunyit.edu (8.8.7/8.8.5) with SMTP id UAA19719 for ; Sun, 26 Oct 1997 20:45:02 -0500 (EST) X-Authentication-Warning: server.local.sunyit.edu: perlsta owned process doing -bs Date: Sun, 26 Oct 1997 20:45:01 -0500 (EST) From: Alfred Perlstein X-Sender: perlsta@server.local.sunyit.edu To: hackers@FreeBSD.org Subject: help with fstat? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk 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