Source : dibs
-Version :2.1.56
+Version :2.1.57
Maintainer : taejun ha<taejun.ha@samsung.com>, jiil hyoun <jiil.hyoun@samsung.com>, donghyuk yang <donghyouk.yang@samsung.com>, donghee yang <donghee.yang@samsung.com>, sungmin kim <dev.sungmin.kim@samsung.com
Package : tizen-dibs-test
protected
def send_file_to_remote2(file_path, dock = "0")
- result = true
ruby_path=File.join(Config::CONFIG["bindir"],
Config::CONFIG["RUBY_INSTALL_NAME"] +
end
cmd = Utils.generate_shell_command( cmd )
- IO.popen("#{cmd} 2>&1") do |io|
- if @log.path.nil? then
- io.each do |l|
- if l.start_with?("=TRANSFER_END") then
- break
- else
- puts l
- end
+ proc1 = IO.popen("#{cmd} 2>&1");
+ if @log.path.nil? then
+ while line = proc1.gets()
+ if line.start_with?("=TRANSFER_END") then
+ break
+ else
+ puts line
end
end
- result = Marshal.load(io.read)
end
- return result
+ status = nil
+ begin
+ pid, status = Process.waitpid2( proc1.pid )
+ rescue Errno::ECHILD
+ return false
+ end
+
+ return ((not status.nil? and status.exitstatus == 0) ? true : false);
end
cmd = "#{ruby_path} \"#{File.expand_path(File.dirname(__FILE__))}/receive_file.rb\" #{@addr} #{@port} #{dock} \"#{file_path}\" #{ftp_addr} #{ftp_port} #{ftp_username} #{ftp_passwd} \"#{@log.path}\""
end
cmd = Utils.generate_shell_command( cmd )
- IO.popen("#{cmd} 2>&1") do |io|
- if @log.path.nil? then
- io.each do |l|
- if l.start_with?("=TRANSFER_END") then
- @log.info("transfered")
- @log.info(l)
- break
- else
- puts l
- end
+ proc1 = IO.popen("#{cmd} 2>&1");
+ if @log.path.nil? then
+ while line = proc1.gets()
+ if line.start_with?("=TRANSFER_END") then
+ break
+ else
+ puts line
end
end
- ioread = io.read
- @log.info("marshal load : [#{ioread}]")
- result = Marshal.load(ioread)
end
- return result
+ status = nil
+ begin
+ pid, status = Process.waitpid2( proc1.pid )
+ rescue Errno::ECHILD
+ return false
+ end
+
+ return ((not status.nil? and status.exitstatus == 0) ? true : false);
end
end