[comp.sys.atari.st] Quick Directory Size

iadt2tg@prism.gatech.EDU (Terry O. Greenlaw) (03/04/89)

What is the quickest way to find out the total byte size of all files
in the current subdirectory? I need the size to do the equivalent of
a "ls -l", and I'd rather not add up the individual file sizes. 

leo@philmds.UUCP (Leo de Wit) (03/14/89)

In article <305@hydra.gatech.EDU> iadt2tg@prism.gatech.EDU (Terry O. Greenlaw) writes:
|What is the quickest way to find out the total byte size of all files
|in the current subdirectory? I need the size to do the equivalent of
|a "ls -l", and I'd rather not add up the individual file sizes. 

As far as I know TOS only has a call to get the size (used and unused)
of a device (my handbook says: GEMDOS 0x36, Get Disk Free Space; my
compiler calls it : Dfree()). So probably summing up the sizes is the
only way to go (correct me if I'm wrong).

I wrote once a UNIX style du; du -s gives you the number of blocks used
by all files in the current directory (recursively); du -a gives the
block usage for each file individually too. If that's what you want I
could check it out and submit it to the sources / binaries groups.
You can try to outperform this by reading the directory sector(s), but
I doubt if it's worth the effort.
Anyone interested send me fanmail.

	Leo.

gjh@otter.hpl.hp.com (Graham Higgins) (03/14/89)

There's an "easy" way (saves writing software) -- just cd to the parent
directory and use "du" with the target directory as an argument --- 
Hey, it's an immediate solution, if somewhat tacky.


Cheers,

Graham
======

------------------------------------------------------------------
Graham Higgins @ HP Labs      	|  Phone: (0272) 799910 x 24060
Information Systems Centre    	|  gray@hpl.hp.co.uk
Bristol                       	|  gray%hplb.uucp@ukc.ac.uk
U.K.                          	|  gray@hplb.hpl.hp.com
 

ralph@laas.laas.fr (Ralph P. Sobek) (03/22/89)

In article <975@philmds.UUCP>, leo@philmds.UUCP (Leo de Wit) writes:
| In article <305@hydra.gatech.EDU> iadt2tg@prism.gatech.EDU (Terry O. Greenlaw) writes:
| |What is the quickest way to find out the total byte size of all files
| |in the current subdirectory? I need the size to do the equivalent of
| |a "ls -l", and I'd rather not add up the individual file sizes. 
| 
| I wrote once a UNIX style du; du -s gives you the number of blocks used
| by all files in the current directory (recursively); du -a gives the
| block usage for each file individually too. If that's what you want I
| could check it out and submit it to the sources / binaries groups.

I believe that the ST Unix ToolKit already has an implementation of du
available.  It was posted to the binaries group and is available on
ssyx.
-- 
Ralph P. Sobek			  Disclaimer: The above ruminations are my own.
ralph@laas.laas.fr			   Addresses are ordered by importance.
ralph@laas.uucp, or ...!uunet!mcvax!laas!ralph		If all else fails, try:
SOBEK@FRMOP11.BITNET				      sobek@eclair.Berkeley.EDU