Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Nov 2003 15:30:34 -0800
From:      Erik Steffl <steffl@bigfoot.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: detecting the size of a tarball
Message-ID:  <3FA8369A.3020505@bigfoot.com>
In-Reply-To: <20031104161008.E32148@asu.edu>
References:  <20031104161008.E32148@asu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3FA8369A.3020505>