lib/backup/file_item/local.rb in encbs-0.2.1 vs lib/backup/file_item/local.rb in encbs-0.2.2
- old
+ new
@@ -13,13 +13,17 @@
directories.each do |path|
FileUtils.mkdir_p(path) unless File.directory? path
end
end
+ def exists? file
+ File.exists? file
+ end
+
def create_file_once file, data
data = data.read if data.is_a? File or data.is_a? StringIO
File.open(file, 'wb') do |f|
- f.puts(data)
+ f.print(data)
end unless File.exists?(file)
end
def read_file file
File.open(file, 'rb') do |f|