From 469d2117ae2e0239fbcc1fca6d4d32d888c6f9e9 Mon Sep 17 00:00:00 2001 From: Sam Smoot Date: Thu, 7 Jun 2012 15:51:43 -0500 Subject: [PATCH] Removed ftools dependency and replaced with FileUtils. --- lib/zip/zip.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/zip/zip.rb b/lib/zip/zip.rb index 8ecc446..fe21c9a 100644 --- a/lib/zip/zip.rb +++ b/lib/zip/zip.rb @@ -1,7 +1,7 @@ require 'delegate' require 'singleton' require 'tempfile' -require 'ftools' +require 'fileutils' require 'stringio' require 'zlib' require 'zip/stdrubyext' @@ -663,8 +663,9 @@ def set_extra_attributes_on_path(destPath) # :nodoc: # ignore setuid/setgid bits by default. honor if @restore_ownership unix_perms_mask = 01777 unix_perms_mask = 07777 if (@restore_ownership) - File::chmod(@unix_perms & unix_perms_mask, destPath) if (@restore_permissions && @unix_perms) - File::chown(@unix_uid, @unix_gid, destPath) if (@restore_ownership && @unix_uid && @unix_gid && Process::egid == 0) + FileUtils::chmod(@unix_perms & unix_perms_mask, destPath) if (@restore_permissions && @unix_perms) + FileUtils::chown(@unix_uid, @unix_gid, destPath) if (@restore_ownership && @unix_uid && @unix_gid && Process::egid == 0) + # File::utimes() end end @@ -1567,7 +1568,7 @@ def on_success_replace(aFilename) tmpFilename = tmpfile.path tmpfile.close if yield tmpFilename - File.move(tmpFilename, name) + File.rename(tmpFilename, name) end end