Create a new directory if it`s missing

標簽: 瀏覽(5630)  日期:2007-04-21
  def create_if_missing *names
    names.each do |name| FileUtils.mkdir_p(name) unless File.directory?(name) end
  end



-------------------------------------------------
上一篇:Installing Ruby on Rails with Lighttpd and MySQL on Fedora C

a   2007-04-21

FileUtils.mkdir_p whatever

a   2007-04-21

FileUtils.mkdir(whatever) rescue nil



  
Are you Bot? How you know that?ofcz no.