summaryrefslogtreecommitdiffstats
path: root/lib/ftools.rb
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-05 08:40:11 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-05 08:40:11 +0000
commit348746f66f9df54f66f83478093a6189f5d140df (patch)
tree7f267192da09fc3df73f4ed1a43cf2a2eeba7cec /lib/ftools.rb
parentedc3d8d6c6577f47955fe15283e8628b2ce2ac0d (diff)
downloadruby-348746f66f9df54f66f83478093a6189f5d140df.tar.gz
ruby-348746f66f9df54f66f83478093a6189f5d140df.tar.xz
ruby-348746f66f9df54f66f83478093a6189f5d140df.zip
eban
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/ftools.rb')
-rw-r--r--lib/ftools.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/ftools.rb b/lib/ftools.rb
index 39d6ca946..369a6177d 100644
--- a/lib/ftools.rb
+++ b/lib/ftools.rb
@@ -81,7 +81,7 @@ class << File
syscopy from, to and unlink from
utime(from_stat.atime, from_stat.mtime, to)
begin
- chown(fstat.uid, fstat.gid, tpath)
+ chown(fstat.uid, fstat.gid, to)
rescue
end
end
@@ -110,7 +110,8 @@ class << File
begin
while fr == tr
- if fr = from.read(fsize)
+ fr = from.read(fsize)
+ if fr
tr = to.read(fr.size)
else
ret = to.read(fsize)
@@ -136,7 +137,7 @@ class << File
begin
$stderr.print files.join(" "), "\n" if verbose
chmod 0777, *files
- unlink *files
+ unlink(*files)
rescue
# STDERR.print "warning: Couldn't unlink #{files.join ' '}\n"
end
@@ -163,11 +164,13 @@ class << File
alias o_chmod chmod
+ vsave, $VERBOSE = $VERBOSE, false
def chmod(mode, *files)
verbose = if files[-1].is_a? String then false else files.pop end
$stderr.printf "chmod %04o %s\n", mode, files.join(" ") if verbose
o_chmod mode, *files
end
+ $VERBOSE = vsave
def install(from, to, mode = nil, verbose = false)
to = catname(from, to)