Changeset 743


Ignore:
Timestamp:
11/16/08 20:35:05 (3 years ago)
Author:
OlivierRaginel
Message:

Item38: Removed backticks: use sandbox

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DiskUsagePlugin/lib/TWiki/Plugins/DiskUsagePlugin.pm

    r529 r743  
    109109 
    110110sub diskusage { 
     111    my $sandbox = $TWiki::sharedSandbox || $TWiki::sandbox; 
    111112    my $web = TWiki::Func::extractNameValuePair( @_, "web" ); 
    112113    $web =~ s/\W//go; 
     
    114115    my $datadir = $TWiki::cfg{DataDir}; 
    115116    my $cmd = "/usr/bin/du -b $datadir/$web/*.txt 2>&1"; 
    116     my @lines = `$cmd`; 
     117    my ( $result, $code ) = $sandbox->sysCommand( $cmd ); 
     118    my @lines = split m#$/#, $result; 
    117119    my %usageByTopic; 
    118120 
     
    127129    my $pubdir = $TWiki::cfg{PubDir}; 
    128130    $cmd = "/usr/bin/du -b $pubdir/$web/* 2>&1"; 
    129  
    130     @lines = `$cmd`; 
     131    ( $result, $code ) = $sandbox->sysCommand( $cmd ); 
     132    @lines = split m#$/#, $result; 
     133 
    131134    my %pubByTopic; 
    132135 
     
    158161sub quotaData { 
    159162    my $cmd = "/usr/bin/quota -v 2>&1"; 
    160  
    161     my @lines = `$cmd`; 
     163    my $sandbox = $TWiki::sharedSandbox || $TWiki::sandbox; 
     164 
     165    my ( $result, $code ) = $sandbox->sysCommand( $cmd ); 
     166    my @lines = split m#$/#, $result; 
     167 
    162168    my $lastLine = $lines[$#lines] || ""; 
    163169    my @fields = split /\s+/, $lastLine; 
Note: See TracChangeset for help on using the changeset viewer.