func_file_readfile.rst 861 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .. _func_file_readfile:
  2. ========
  3. ReadFile
  4. ========
  5. ReadFile -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. ReadFile:TStream( url:Object )
  10. Open a file for input.
  11. This command is similar to the #ReadStream command but will attempt
  12. to cache the contents of the file to ensure serial streams such as
  13. http: based url's are seekable. Use the #CloseStream command when
  14. finished reading and or writing to a Stream returned by #OpenFile.
  15. Parameters
  16. ==========
  17. Return Values
  18. =============
  19. Nothing.
  20. Examples
  21. ========
  22. .. code-block:: blitzmax
  23. ' readfile.bmx
  24. ' the following prints the contents of this source file
  25. file=readfile("readfile.bmx")
  26. if not file runtimeerror "could not open file openfile.bmx"
  27. while not eof(file)
  28. print readline(file)
  29. wend
  30. closestream file
  31. See Also
  32. ========