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?): check by inode instead of path name, to detect two hard links pointing to the same content.

* test/fileutils.rb: did not create correctly looped symlinks.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
aamine 2003-11-18 10:05:21 +00:00
parent 0c15b3a222
commit 1c0cee4f83
3 changed files with 16 additions and 35 deletions

View file

@ -149,11 +149,11 @@ end
cp 'tmp/cptmp', 'tmp/cptmp'
}
if have_symlink?
File.symlink 'tmp/cptmp', 'tmp/cptmp_symlink'
File.symlink 'cptmp', 'tmp/cptmp_symlink'
assert_raises(ArgumentError) {
cp 'tmp/cptmp', 'tmp/cptmp_symlink'
}
File.symlink 'tmp/symlink', 'tmp/symlink'
File.symlink 'symlink', 'tmp/symlink'
assert_raises(Errno::ELOOP) {
cp 'tmp/symlink', 'tmp/symlink'
}
@ -180,11 +180,11 @@ end
mv 'tmp/cptmp', 'tmp/cptmp'
}
if have_symlink?
File.symlink 'tmp/cptmp', 'tmp/cptmp_symlink'
File.symlink 'cptmp', 'tmp/cptmp_symlink'
assert_raises(ArgumentError) {
mv 'tmp/cptmp', 'tmp/cptmp_symlink'
}
File.symlink 'tmp/symlink', 'tmp/symlink'
File.symlink 'symlink', 'tmp/symlink'
assert_raises(Errno::ELOOP) {
mv 'tmp/symlink', 'tmp/symlink'
}
@ -412,11 +412,11 @@ end
install 'tmp/cptmp', 'tmp/cptmp'
}
if have_symlink?
File.symlink 'tmp/cptmp', 'tmp/cptmp_symlink'
File.symlink 'cptmp', 'tmp/cptmp_symlink'
assert_raises(ArgumentError) {
install 'tmp/cptmp', 'tmp/cptmp_symlink'
}
File.symlink 'tmp/symlink', 'tmp/symlink'
File.symlink 'symlink', 'tmp/symlink'
assert_raises(Errno::ELOOP) {
install 'tmp/symlink', 'tmp/symlink'
}