From: Simon Harrison Date: 2011-07-14T05:55:41+09:00 Subject: Creating a range of directories I'm wanting to create a range of directories with a prefix, like the following: /prefix-001 /prefix-002 etc. The following works, but seems to smell a bit. *************************** require 'fileutils' include FileUtils var = 1..100 dirs = var.map { |n| "%03d" % n } dirs.each { |n| n.insert(0, "Prefix-") } mkdir(dirs) **************************** Any better ways to accomplish this? And, does anyone know of a good tutorial/book for working with files and directories? Cheers -- Posted via http://www.ruby-forum.com/.