On 2010-02-08, Greg Willits <lists / gregwillits.ws> wrote:
> So, I was surprised to find out that Dir.mkdir will not create all
> folders in a path when more than just the last level does not exist.
> Example: Dir.mkdir('/f1/f2/f3') will not create /f3 when /f2 does not
> exist. I expected it to make both /f2 and /f3 to get the job done. I
> expected it because the language I used most previously did do that.
>
> After some googling I'm not finding any elegant solutions.
>
> Obviously I could split the path at / and iterate through each folder
> name in sequence with an Exists? and mkdir follow up if needed.
>
> Is that really the only option? To do this manually?

%x{mkdir -p "#{dir}"}
?

-s
-- 
Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nospam / seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!