about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-07-21 02:18:45 +0200
committerhut <hut@lavabit.com>2009-07-21 02:18:45 +0200
commit2ed66adc4e0a1c1e19fffdf4042f741d358115ea (patch)
tree9b5673dab1105a5304b9c5b2c1f86202408ec28f
parent42cf435bb9a210e267584156abb0e435cf14a6e3 (diff)
downloadranger-2ed66adc4e0a1c1e19fffdf4042f741d358115ea.tar.gz
modified `df` flags
I shouldn't use df.. look for alternatives
-rw-r--r--TODO14
-rw-r--r--code/directory.rb4
2 files changed, 10 insertions, 8 deletions
diff --git a/TODO b/TODO
index ebe9a157..6a0fe02f 100644
--- a/TODO
+++ b/TODO
@@ -1,8 +1,9 @@
 Required for next Release
 
-   (X) #5   09/07/17  avoid using shell calls, it results in many problems
-               can't answer questions of spawned processes
-               specifically rm with write-protected files
+   ( ) #5   09/07/17  avoid using shell calls, it results in many problems
+               - can't answer questions of spawned processes
+                 specifically rm with write-protected files
+               - the flags of df and other tools aren't consistent
    (X) #8   09/07/17  Clear keybuffer after executing programs.
                you may have typed something after the program stopped reading
                this could flush the text to ranger and result in unwanted actions
@@ -23,9 +24,10 @@ Critical Issues
 
 Minor Issues
 
-   (X) #5   09/07/17  avoid using shell calls, it results in many problems
-               can't answer questions of spawned processes
-               specifically rm with write-protected files
+   ( ) #5   09/07/17  avoid using shell calls, it results in many problems
+               - can't answer questions of spawned processes
+                 specifically rm with write-protected files
+               - the flags of df and other tools aren't consistent
    (X) #12  09/07/17  sync @marked with changes in on the file system
                if files are deleted, delete those from @marked too
    (X) #14  09/07/18  Sorting sometimes doesn't work
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