IO.popen hanging

U

Une Bévue

if i do, on terminal :

echo -n "something" | /usr/bin/xclip -selection c

the time to exec is instantaneous.

however using either :

`echo -n "#{@prefix}" | /usr/bin/xclip -selection c `

or :

IO.popen(["/usr/bin/xclip","-selection","c"], "w+") do |io|
io.write @prefix
io.close_write
IO.copy_stream(io, $stdout)
end


@prefix being :
@prefix=Time.new.strftime("%y-%m-%d--%H-%M-%S--")

it takes several minutes...

why ?
 
R

Robert Klemme

if i do, on terminal :

echo -n "something" | /usr/bin/xclip -selection c

the time to exec is instantaneous.

however using either :

`echo -n "#{@prefix}" | /usr/bin/xclip -selection c `

or :

IO.popen(["/usr/bin/xclip","-selection","c"], "w+") do |io|
io.write @prefix
io.close_write
IO.copy_stream(io, $stdout)
end


@prefix being :
@prefix=Time.new.strftime("%y-%m-%d--%H-%M-%S--")

it takes several minutes...

why ?

I have no idea. You could try to use strace to show what xclip is doing
all the time.

Kind regards

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top