From owner-freebsd-questions@FreeBSD.ORG Tue Nov 4 15:31:04 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C658416A4CE for ; Tue, 4 Nov 2003 15:31:04 -0800 (PST) Received: from mrout2.yahoo.com (mrout2.yahoo.com [216.145.54.172]) by mx1.FreeBSD.org (Postfix) with ESMTP id 20F9543FF5 for ; Tue, 4 Nov 2003 15:31:04 -0800 (PST) (envelope-from steffl@bigfoot.com) Received: from bigfoot.com (woodpecker.corp.yahoo.com [207.126.234.69]) hA4NUYSI035362 for ; Tue, 4 Nov 2003 15:30:34 -0800 (PST) Message-ID: <3FA8369A.3020505@bigfoot.com> Date: Tue, 04 Nov 2003 15:30:34 -0800 From: Erik Steffl User-Agent: Mozilla/5.0 (X11; U; Linux i386; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <20031104161008.E32148@asu.edu> In-Reply-To: <20031104161008.E32148@asu.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: detecting the size of a tarball X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2003 23:31:04 -0000 David Bear wrote: > I have a 100 mg zip drive that I'm writing to as a raw device -- no > file system -- just 'tar cvf /dev/afd0 stuff'. I am curious if there > is a way to find out how big the tarball is on this kind of thing. > I'm guessing maybe some kind of seek to EOF but not sure how it might > be accomplished. any idea's? this might work (probably reads whole file): cat < /dev/afd0 | wc -c or perhaps this one: du /dev/afd0 you can try this: perl -e '$filename = "/dev/afd0"; print "siz eof [$filename] is [" . (stat($filename))[7] . "]\n";' not sure if that would be any different than ls -l though... erik