/tutorial/io/low_level_redirection_example.e

http://github.com/tybor/Liberty · Specman e · 33 lines · 28 code · 5 blank · 0 comment · 0 complexity · 154469db732b3b38fe6818fed62f3566 MD5 · raw file

  1. class LOW_LEVEL_REDIRECTION_EXAMPLE
  2. insert
  3. STREAM_HANDLER
  4. create {}
  5. make
  6. feature {}
  7. make
  8. do
  9. std_input.redirect_from("low_level_redirection_example.e")
  10. check
  11. std_input.redirection_succeeded
  12. end
  13. std_output.redirect_to("low_level_redirection_example.log")
  14. check
  15. std_output.redirection_succeeded
  16. end
  17. from
  18. std_input.read_line
  19. until
  20. std_input.end_of_input
  21. loop
  22. std_output.put_line(std_input.last_string)
  23. std_input.read_line
  24. end
  25. std_input.restore_default_input
  26. std_output.restore_default_output
  27. end
  28. end -- class LOW_LEVEL_REDIRECTION_EXAMPLE