summaryrefslogtreecommitdiff
path: root/ruby/named-pipe-a.rb
blob: 23e260c6a00b7ab2523abe298b3e52d5b7aee3f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env ruby

`mkfifo #{ARGV[0]}`
f = File.new "#{ARGV[0]}", 'w'

while line = STDIN.gets
  f.write line+"\n"
  f.flush
end

`rm #{ARGV[0]}`