From 2ed66adc4e0a1c1e19fffdf4042f741d358115ea Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 21 Jul 2009 02:18:45 +0200 Subject: modified `df` flags I shouldn't use df.. look for alternatives --- code/directory.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'code') diff --git a/code/directory.rb b/code/directory.rb index 8e8f2269..5ced4fae 100644 --- a/code/directory.rb +++ b/code/directory.rb @@ -110,10 +110,10 @@ class Directory if @free_space then return @free_space end @free_space = 0 - out = `df -PB 1 #{~path}` + out = `df -Pk #{~path}` out = out[out.index("\n")+1, out.index("\n", out.index("\n"))] if out =~ /^[^\s]+ \s+ \d+ \s+ \d+ \s+ (\d+) \s+/x - @free_space = $1.to_i + @free_space = $1.to_i * 1024 end @free_space end -- cgit 1.4.1-2-gfad0