Sha256: df89e2b69b666f4c87b82f4f7c9fb5b00f5aa62aead9045da9e5dea84af54a26
Contents?: true
Size: 325 Bytes
Versions: 11
Compression:
Stored size: 325 Bytes
Contents
#!/usr/bin/env ruby fifo_dir = 'tmp' fifo_file = 'test_fifo' fifo_path = ['.', fifo_dir, fifo_file].join('/') trap 2 do File.delete(fifo_path) exit end Dir.mkdir(fifo_dir) unless Dir.exist?(fifo_dir) `mkfifo #{fifo_path}` unless File.exist?(fifo_path) input = open(fifo_path, 'r+') loop do system input.gets end
Version data entries
11 entries across 11 versions & 1 rubygems