Project

General

Profile

Bug #13941 » test.rb

Test script - graywolf (Gray Wolf), 09/26/2017 12:10 AM

 
#!/usr/bin/env ruby

require 'thread'

def beat_thread
$stop = false
bt = Thread.new do
loop do
print "."
sleep 0.25
break if $stop
end
end
yield
$stop = true
bt.join
end

puts "File exist?:"
beat_thread { File.exist? 'blocking_dir/file54' }

puts

puts "File read:"
beat_thread { File.read 'blocking_dir/file54' }
(3-3/4)