class Fluent::Plugin::TailInput::FilePositionEntry

pos inode fffffffffffffffftffffffffffffffffn

Constants

INO_OFFSET
INO_SIZE
LN_OFFSET
POS_SIZE
SIZE

Public Class Methods

new(file, seek) click to toggle source
# File lib/fluent/plugin/in_tail.rb, line 848
def initialize(file, seek)
  @file = file
  @seek = seek
  @pos = nil
end

Public Instance Methods

read_inode() click to toggle source
# File lib/fluent/plugin/in_tail.rb, line 866
def read_inode
  @file.pos = @seek + INO_OFFSET
  raw = @file.read(16)
  raw ? raw.to_i(16) : 0
end
read_pos() click to toggle source
# File lib/fluent/plugin/in_tail.rb, line 872
def read_pos
  @pos ||= begin
    @file.pos = @seek
    raw = @file.read(16)
    raw ? raw.to_i(16) : 0
  end
end
update(ino, pos) click to toggle source
# File lib/fluent/plugin/in_tail.rb, line 854
def update(ino, pos)
  @file.pos = @seek
  @file.write "%016x\t%016x" % [pos, ino]
  @pos = pos
end
update_pos(pos) click to toggle source
# File lib/fluent/plugin/in_tail.rb, line 860
def update_pos(pos)
  @file.pos = @seek
  @file.write "%016x" % pos
  @pos = pos
end