From 4ed0c6e8cd44b32e7bbe4935dd20fc7554166fac Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 6 Jul 2009 17:44:34 +0200 Subject: rely less on system calls for mkdir/touch --- code/keys.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'code') diff --git a/code/keys.rb b/code/keys.rb index e4f33e2d..21a6335e 100644 --- a/code/keys.rb +++ b/code/keys.rb @@ -83,9 +83,10 @@ module Fm if str =~ /^\s?(.*)(|)$/ @buffer = '' if $2 == '' - closei - system('mkdir', $1) - starti + begin + Dir.mkdir($1) + rescue + end @pwd.schedule end end @@ -95,9 +96,10 @@ module Fm if str =~ /^\s?(.*)(|)$/ @buffer = '' if $2 == '' -# closei - system('touch', $1) -# starti + begin + File.open($1, 'a').close + rescue + end @pwd.schedule end end -- cgit 1.4.1-2-gfad0