1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/fileutils.rb (fu_same?): temporal fix for windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
aamine 2003-11-18 13:24:48 +00:00
parent 17db383050
commit 6874cb465a
2 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Tue Nov 18 22:20:10 2003 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb (fu_same?): temporal fix for windows.
Tue Nov 18 19:05:04 2003 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb (fu_same?): check by inode instead of path

View file

@ -465,7 +465,7 @@ module FileUtils
alias move mv
def cannot_overwrite_file? #:nodoc:
/djgpp|cygwin|mswin32/ === RUBY_PLATFORM
/djgpp|cygwin|mswin|mingw/ === RUBY_PLATFORM
end
private :cannot_overwrite_file?
@ -739,11 +739,19 @@ module FileUtils
end
def fu_same?( a, b )
File.stat(a).ino == File.stat(b).ino
if have_st_ino?
File.stat(a).dev == File.stat(b).dev and File.stat(a).ino == File.stat(b).ino
else
File.expand_path(a) == File.expand_path(b)
end
rescue Errno::ENOENT
return false
end
def have_st_ino?
/mswin|mingw/ !~ RUBY_PLATFORM
end
def fu_stream_blksize( *streams )
streams.each do |s|
next unless s.respond_to?(:stat)