Help for this page

Select Code to Download


  1. or download this
    my ($Size)=( (qx{dir /s "$TargetPath"})[-2]=~ /([\d,]+) bytes/ );
    
  2. or download this
    my ($Size)=( (qx{dir /s "$TargetPath" | find "bytes" })[-2]=~ /([\d,]+
    +) bytes/ );
    
  3. or download this
    use Win32::OLE;
    
    my $size = Win32::OLE->CreateObject('Scripting.FileSystemObject')
        ->GetFolder( $TargetPath )
        ->size();
    
  4. or download this
    my (@dirs, @files) = ($TargetPath);
    scalar map{ 
        push @{ (-d) ? \@dirs : \@files }, $_ 
    } glob pop(@dirs) . '/*' while @dirs;
    my $size += -s for @files;