File.makedirs and permissions

In ftools.rb (Ruby 1.6.7) I see:

def makedirs(*dirs)
verbose = if dirs[-1].is_a? String then false else dirs.pop end

mode = if dirs[-1].is_a? Fixnum then dirs.pop else 0755 end

mode = 0755
for dir in dirs
  next if FileTest.directory? dir
  parent = dirname(dir)
  makedirs parent unless FileTest.directory? parent
  $stderr.print "mkdir ", dir, "\n" if verbose
  if basename(dir) != ""
    Dir.mkdir dir, mode
  end 
end

end

Looks like makedirs used to allow specifying the mode (since the code is
there but is commented-out), but it does not any more. Does anyone know
why this was changed? Will I be able to specify the mode in the future?

Is there an easy workaround for this with Ruby 1.6.7? (Ruby 1.7 has
both ftools and fileutils, and fileutils’s makedirs appears to not
explicitly set the mode).

BTW, what’s the difference between fileutils and ftools? Is ftools
deprecated?

Paul

Looks like makedirs used to allow specifying the mode (since the code is
there but is commented-out), but it does not any more. Does anyone know
why this was changed?

My guess would be that mode is only really supported on *nix platforms

Rob

-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
http://www.newsfeed.com The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----