class Fluent::TailPathInput::FilePositionEntry

pos inode fffffffffffffffftffffffffn

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_tailpath.rb, line 445
def initialize(file, seek)
  @file = file
  @seek = seek
end

Public Instance Methods

read_inode() click to toggle source
# File lib/fluent/plugin/in_tailpath.rb, line 461
def read_inode
  @file.pos = @seek + INO_OFFSET
  raw = @file.read(8)
  raw ? raw.to_i(16) : 0
end
read_pos() click to toggle source
# File lib/fluent/plugin/in_tailpath.rb, line 467
def read_pos
  @file.pos = @seek
  raw = @file.read(16)
  raw ? raw.to_i(16) : 0
end
update(ino, pos) click to toggle source
# File lib/fluent/plugin/in_tailpath.rb, line 450
def update(ino, pos)
  @file.pos = @seek
  @file.write "%016x\t%08x" % [pos, ino]
  @inode = ino
end
update_pos(pos) click to toggle source
# File lib/fluent/plugin/in_tailpath.rb, line 456
def update_pos(pos)
  @file.pos = @seek
  @file.write "%016x" % pos
end