From: "prijutme4ty (Ilya Vorontsov)" Date: 2012-07-29T20:34:46+09:00 Subject: [ruby-core:46854] [ruby-trunk - Feature #6811][Open] File, Dir and FileUtils should have bang-versions of singleton methods that fails silently Issue #6811 has been reported by prijutme4ty (Ilya Vorontsov). ---------------------------------------- Feature #6811: File, Dir and FileUtils should have bang-versions of singleton methods that fails silently https://bugs.ruby-lang.org/issues/6811 Author: prijutme4ty (Ilya Vorontsov) Status: Open Priority: Normal Assignee: Category: Target version: I found that often write Dir.mkdir(folder) unless Dir.exist? folder and similar code for rm, rm_rf and so on We can simply make bang-versions like def Dir.mkdir!(folder, permissions=0744) Dir.mkdir(folder, permissions) unless Dir.exist? folder # or another alternative Dir.mkdir(folder, permissions) rescue false end -- http://bugs.ruby-lang.org/