public
Created

Test script for Bug #8594: https://bugs.ruby-lang.org/issues/8594

  • Download Gist
tst.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
def try
yield
print '.'
rescue Errno::EINVAL
print 'i'
sleep 1
rescue Errno::ENOENT
print 'n'
sleep 1
rescue Errno::EACCES
print 'a'
sleep 1
rescue Errno::EBADF
print 'b'
sleep 1
rescue Errno::ENETDOWN
print 'd'
sleep 1
rescue Errno::ERANGE
print 'r'
sleep 1
end
 
50.times do
filebase = 'shakeshake-' + Time.new.to_i.to_s
print "\ncreate " ; 50.times { |i| try { File.write('%s_%d' % [filebase, i], 'a' * 100_000) } }
print "\nrename " ; 50.times { |i| try { File.rename('%s_%d' % [filebase, i], 'deleteme_%d' % [i]) } }
print "\ndelete " ; 50.times { |i| try { File.unlink('deleteme_%d' % [i]) } }
puts
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.