class Zold::Node::NohupLog

Log facility for nohup

Public Class Methods

new(file, max) click to toggle source
# File lib/zold/commands/node.rb, line 490
def initialize(file, max)
  @file = file
  raise "Truncation size is too small (#{max}), should be over 10Kb" if max < 10 * 1024
  @max = max
end

Public Instance Methods

copy(source, target, start = 0) click to toggle source
# File lib/zold/commands/node.rb, line 511
def copy(source, target, start = 0)
  total = 0
  File.open(target, 'w') do |t|
    File.open(source, 'r').each do |line|
      next unless total >= start
      t.print(line)
      total += 1
    end
  end
  total
end
print(data) click to toggle source