From owner-freebsd-current Sun Jun 16 09:30:05 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id JAA23763 for current-outgoing; Sun, 16 Jun 1996 09:30:05 -0700 (PDT) Received: from alpha.xerox.com (alpha.Xerox.COM [13.1.64.93]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id JAA23742 for ; Sun, 16 Jun 1996 09:30:01 -0700 (PDT) Received: from gemini.sdsp.mc.xerox.com ([13.231.132.20]) by alpha.xerox.com with SMTP id <14723(8)>; Sun, 16 Jun 1996 09:29:28 PDT Received: by gemini.sdsp.mc.xerox.com (4.1/SMI-4.1-TB) id AA21697; Sun, 16 Jun 96 12:29:57 EDT Message-Id: <9606161629.AA21697@gemini.sdsp.mc.xerox.com> To: asami@cs.berkeley.edu (Satoshi Asami) Cc: current@freebsd.org Subject: Re: how to find size of special file In-Reply-To: Your message of "Sat, 15 Jun 1996 03:44:28 PDT." <199606151044.DAA00936@silvia.HIP.Berkeley.EDU> Date: Sun, 16 Jun 1996 09:29:56 PDT From: "Marty Leisner" Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >nor the less obvious > > int fd ; > struct stat sb ; > fd = open(filename, ...) ; > size = lseek(fd, 0, SEEK_END) ; > >work on special files, even if they are disk partitions. (They both >work on regular files....) > >Satoshi Hmm... wc filename will work...did the open work? What errno is it returning?