Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FTP_HOST = "ftp.pepe.com"
- FTP_USER = "coco"
- FTP_PASS = "coco"
- # create>> dd if=/dev/zero of=output.file bs=1024 count=1024
- UPLOAD_FILE = File.new("./output.file")
- def upload_file
- file_time = Time.now.strftime("%Y%m%d%H%M%S%L")
- file_name = "file_#{file_time}-#{Thread.current.object_id}-.xxx"
- puts "Uploading: #{file_name} [size: #{UPLOAD_FILE.size}]"
- puts Benchmark.measure {
- Net::FTP.open(FTP_HOST, FTP_USER, FTP_PASS) do |ftp|
- ftp.putbinaryfile(UPLOAD_FILE, file_name)
- end
- }
- end
- threads = []
- 130.times {
- threads << Thread.new { upload_file }
- }
- threads.each { |thr| thr.join }
Add Comment
Please, Sign In to add comment