Permalink
Browse files

Removed ftools dependency and replaced with FileUtils.

  • Loading branch information...
sam committed Jun 7, 2012
1 parent e9c90b2 commit 469d2117ae2e0239fbcc1fca6d4d32d888c6f9e9
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/zip/zip.rb
View
@@ -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

0 comments on commit 469d211

Please sign in to comment.