diff --git a/lib/fog/local/models/storage/file.rb b/lib/fog/local/models/storage/file.rb index ea083dfc9..bc7e80b9d 100644 --- a/lib/fog/local/models/storage/file.rb +++ b/lib/fog/local/models/storage/file.rb @@ -95,8 +95,10 @@ module Fog next end # create directory if it doesn't already exist - unless ::File.directory?(dir_path) + begin Dir.mkdir(dir_path) + rescue Errno::EEXIST + raise unless ::File.directory?(dir_path) end end file = ::File.new(path, 'wb')