Module: RIO::Ops::Stream::Output

Includes:
Cp::Stream::Output, Status, Write
Included in:
Stream::InOut, Stream::Output
Defined in:
lib/rio/ops/stream/output.rb

Instance Method Summary collapse

Methods included from Cp::Stream::Output

#<, #<<

Methods included from Cp::Util::InOut

#cpclose, #cpclose0

Methods included from Write

#_!, #print, #print!, #printf, #printf!, #putc, #putc!, #puts, #puts!, #write, #write!

Methods included from Status

#closed?, #eof?, #open?, #stat

Instance Method Details

#close_write(&block) ⇒ Object



66
67
68
69
70
# File 'lib/rio/ops/stream/output.rb', line 66

def close_write(&block)
  self.iow.close_write
  each(&block) if block_given?
  self
end

#copycloseObject



87
88
89
90
91
92
93
94
95
# File 'lib/rio/ops/stream/output.rb', line 87

def copyclose()
  #p "#{callstr('copyclose')} closeoncopy=#{cx['closeoncopy']} iow=#{iow}"
  #raise RuntimeError,"copclose"
  if cx['closeoncopy']
    wclose
  else
    self
  end
end

#putrec(rec, *args) ⇒ Object



57
58
59
60
# File 'lib/rio/ops/stream/output.rb', line 57

def putrec(rec,*args)
  self.put_(rec,*args)
  self
end

#putrec!(rec, *args) ⇒ Object



62
63
64
# File 'lib/rio/ops/stream/output.rb', line 62

def putrec!(rec,*args)
  rtn_close { self.put_(rec,*args) }
end

#rtn_close(*args) {|args| ... } ⇒ Object

Yields:

  • (args)


82
83
84
85
# File 'lib/rio/ops/stream/output.rb', line 82

def rtn_close(*args,&block) 
  yield(*args)
  wclose
end

#then_close(*args, &block) ⇒ Object



76
77
78
79
80
# File 'lib/rio/ops/stream/output.rb', line 76

def then_close(*args,&block) 
  rtn = yield(*args)
  wclose
  rtn
end

#wcloseObject



72
73
74
# File 'lib/rio/ops/stream/output.rb', line 72

def wclose
  self.close.softreset
end