⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (415 Bytes)
Bug #2992
» test_file_read.rb
phiggins (Pete Higgins)
, 03/21/2010 05:34 AM
require
'digest/md5'
test_file
=
"delete_me"
File
.
open
(
test_file
,
"w"
)
{
|
f
|
f
<<
"0"
*
1_000
}
def
buffered_read
(
path
)
data
=
""
buf
=
""
File
.
open
(
path
,
"rb"
)
do
|
f
|
while
f
.
read
(
16384
,
buf
)
data
<<
buf
end
end
data
end
puts
"Pid:
#{
Process
.
pid
}
"
STDIN
.
gets
100
.
times
do
buffered_read
(
test_file
)
end
GC
.
start
puts
"done"
STDIN
.
gets
require
'fileutils'
FileUtils
.
rm
(
test_file
)
« Previous
1
2
Next »
(2-2/2)
Loading...