1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[local|storage] Add copy_object method to Local::Storage.

This commit is contained in:
Benjamin Manns 2012-02-16 14:34:45 -05:00
parent 82d8cbabc2
commit 553c05ec05

View file

@ -64,6 +64,14 @@ module Fog
def path_to(partial)
::File.join(@local_root, partial)
end
def copy_object(source_directory_name, source_object_name, target_directory_name, target_object_name, options={})
require 'fileutils'
source_path = path_to(::File.join(source_directory_name, source_object_name))
target_path = path_to(::File.join(target_directory_name, target_object_name))
::FileUtils.mkdir_p(::File.dirname(source_path))
::FileUtils.copy_file(source_path, target_path)
end
end
end