⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (486 Bytes)
Bug #10583
ยป spawn_bug_example.rb
Example Testcase -
ezran (Justin Greer)
, 12/09/2014 05:44 PM
# Just set up a fifo to work with.
require
'tempfile'
fifo_path
=
File
.
join
(
Dir
.
tmpdir
,
'spawn_fifo'
)
`mkfifo '
#{
fifo_path
}
'`
puts
"BEFORE SPAWN"
spawned_pid
=
Process
.
spawn
(
"echo hello world"
,
STDOUT
=>
fifo_path
,
:close_others
=>
true
)
########################### STALLS HERE ###########################
puts
"AFTER SPAWN"
# If spawn worked in this case, then we could read the data from the fifo and display it.
data
=
File
.
read
(
fifo_path
)
puts
data
Process
.
waitpid
(
spawned_pid
)
(1-1/1)
Loading...