fork download
  1. #!/usr/bin/env ruby
  2.  
  3. $contents = Array.new
  4.  
  5. def readfile(filename)
  6. if not File.exist? filename
  7. puts "ErrorCode: 1"
  8. exit 1
  9. end
  10.  
  11. begin
  12. File.open(filename) do |file|
  13. file.each do |line|
  14. s_line = line.split('\t')
  15. puts s_line
  16. points = s_line[3].delete(' ').split(',')
  17. s_line = s_line.pop
  18. s_line.push(points)
  19. $contents.push(s_line)
  20. end
  21. end
  22. rescue Exception => e
  23. puts "Exception occured: ", e
  24. end
  25. end
  26.  
  27. def processfile
  28.  
  29. end
  30.  
  31. readfile "file"
  32. processfile
Runtime error #stdin #stdout 0.02s 7460KB
stdin
Standard input is empty
stdout
ErrorCode: 1