File access utility like as 'tee'.
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
pkg
spec
COPYING.LESSER
History
LICENSE
README
Rakefile

README

== README ==

=== How to use ===
require 'file_tee'

# sampe 1
http = Net::HTTP.start("host", port)
File.open("path_to_write", "w") {|wf|
  File.open("path_to_read") {|rf|
    FileTee.open(rf, wf) {|tee|
      req = Net::HTTP::Post.new("url_to_upload")
      req.body_stream = tee
      http.request(req) # In background, write to "path_to_write".
    }
  }
}

# sample 2
http = Net::HTTP.start("host", port)
FileTee.open("path_to_read", "path_to_write") {|tee|
  req = Net::HTTP::Post.new("url_to_upload")
  req.body_stream = tee
  http.request(req) # In background, write to "path_to_write".
}