in reply to Re: diskspace used by a directory
in thread diskspace used by a directory

On a Windows system, `dir /u $dirname` gives something like:
Volume in drive F is Work Serial number is 244F:5AF9 Directory of F:\dev\experiment\ScanWord\* 366,148 bytes in 5 files and 2 dirs 393,216 bytes allocated 4,040,884,224 bytes free
which can be parsed back in.

That's what I get using the 4NT 4.00A command shell; with COMMAND.COM and CMD.EXE results and actual flags to dir may be different.

In one application, I needed to know how much room a set of files would take up, before actually copying them to the target media (A CD-R). The filesystem of the staging area has different properties, so I couldn't just ask the filesystem, but had to compute it myself. Since I was already copying files over, it was easy to accumulate the size, rounding up to the sector size of the target.

—John