in reply to Dirsize using Win32 API call?

Pure API calls would probably be 20-30 lines long, looping over all files in all subdirectories with the FindNextFile api call. If you can be sure that the Windows Scripting is installed (it is on Win98+ & Win2K+, and you can install Windows Script Host on 95 or NT), try using something like this:

#!perl use warnings; use strict; use Win32::OLE; my $fs = Win32::OLE->CreateObject('Scripting.FileSystemObject'); my $dir = 'c:/s'; my $dir_obj = $fs->GetFolder($dir); print $dir_obj->Size(), " bytes used\n"; __END__ Output: 38521553 bytes used

HTH

Replies are listed 'Best First'.
Re: Re: Dirsize using Win32 API call?
by Ritter (Sexton) on Dec 07, 2002 at 23:47 UTC
    Great thanks, you are gold! :)

    Ritter