Skip to content

@luislavena /tst.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Test script for Bug #8594: https://bugs.ruby-lang.org/issues/8594
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.