the file-like interface to a remote file
upon these errors we'll try to rereconnect a few times
# File lib/sup/mbox/ssh-file.rb, line 110 def connect do_remote nil end
# File lib/sup/mbox/ssh-file.rb, line 114 def eof?; @offset >= size; end
# File lib/sup/mbox/ssh-file.rb, line 129 def gets return nil if eof? @buf_mutex.synchronize do make_buf_include @offset expand_buf_forward while @buf.index("\n", @offset).nil? && @buf.endd < size returning(@buf[@offset .. (@buf.index("\n", @offset) || -1)]) { |line| @offset += line.length } end end
# File lib/sup/mbox/ssh-file.rb, line 138 def read n return nil if eof? @buf_mutex.synchronize do make_buf_include @offset, n @buf[@offset ... (@offset += n)] end end
# File lib/sup/mbox/ssh-file.rb, line 116 def seek loc; @offset = loc; end
# File lib/sup/mbox/ssh-file.rb, line 121 def size if @file_size.nil? || (Time.now - @last_size_check) > SIZE_CHECK_INTERVAL @last_size_check = Time.now @file_size = do_remote("wc -c #@fn").split.first.to_i end @file_size end
Generated with the Darkfish Rdoc Generator 2.