Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site sdccsu3.UUCP Path: utzoo!linus!security!genrad!decvax!ittvax!dcdwest!sdcsvax!sdccsu3!brian From: brian@sdccsu3.UUCP Newsgroups: net.micro.cpm Subject: Re: Computing free space on a disk Message-ID: <1417@sdccsu3.UUCP> Date: Mon, 19-Dec-83 09:16:52 EST Article-I.D.: sdccsu3.1417 Posted: Mon Dec 19 09:16:52 1983 Date-Received: Wed, 21-Dec-83 02:14:18 EST References: <456@aplvax.UUCP> Organization: UCSD beer & pizza society Lines: 19 x <- destroy all monsters The easiest way to calculate the available space on a disk is to use the allocation map - the bits turned off in the allocation map are available allocation groups, so you just multiply the number of bits off by the allocation size (available from factors in the disk parameter block) and that is the room left on the disk. You can get pointers to the disk block from the BDOS, then use that to find the allocation vector, maximum number of groups, and the allocation size. See the DRI incomprehensible manuals for the exact details, or take apart the code in one of the public domain directory programs (like SD). Note that using the DPB information makes the program relatively independent of what hardware configuration its running on. -- -Brian Kantor, UC San Diego {decvax,ucbvax} !sdcsvax!sdccsu3!brian Kantor@Nosc